Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ window,

.notification .draw-area {
margin: 16px;
background: alpha(@bg_color, 0.8);
}

.notification:not(.confirmation) .draw-area image {
Expand Down
29 changes: 17 additions & 12 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ css_gresource = gnome.compile_resources(
source_dir: 'data'
)

subdir('protocol')
subdir('data')
subdir('demo')
subdir('po')

executable(
meson.project_name(),
'src/AbstractBubble.vala',
Expand All @@ -28,20 +33,20 @@ executable(
'src/Widgets/MaskedImage.vala',
css_gresource,
dependencies: [
dependency ('libcanberra'),
dependency ('libcanberra-gtk3'),
dependency ('glib-2.0'),
dependency ('gobject-2.0'),
dependency ('gio-2.0'),
dependency ('granite', version: '>=5.4.0'),
dependency ('gtk+-3.0'),
dependency ('libhandy-1')
dependency('libcanberra'),
dependency('libcanberra-gtk3'),
dependency('glib-2.0'),
dependency('gobject-2.0'),
dependency('gio-2.0'),
dependency('granite', version: '>=5.4.0'),
dependency('gdk-wayland-3.0'),
dependency('gdk-x11-3.0'),
dependency('gtk+-3.0'),
dependency('libhandy-1'),
dependency('wayland-client'),
pantheon_desktop_shell_dep
],
install : true
)

subdir('data')
subdir('demo')
subdir('po')

gnome.post_install(glib_compile_schemas: true)
32 changes: 32 additions & 0 deletions protocol/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
dep_scanner = dependency('wayland-scanner', native: true)
prog_scanner = find_program(dep_scanner.get_variable(pkgconfig: 'wayland_scanner'))

protocol_file = files('pantheon-desktop-shell-v1.xml')

pantheon_desktop_shell_sources = []
pantheon_desktop_shell_sources += custom_target(
'pantheon-desktop-shell-client-protocol.h',
command: [ prog_scanner, 'client-header', '@INPUT@', '@OUTPUT@' ],
input: protocol_file,
output: 'pantheon-desktop-shell-client-protocol.h',
)

output_type = 'private-code'
if dep_scanner.version().version_compare('< 1.14.91')
output_type = 'code'
endif
pantheon_desktop_shell_sources += custom_target(
'pantheon-desktop-shell-protocol.c',
command: [ prog_scanner, output_type, '@INPUT@', '@OUTPUT@' ],
input: protocol_file,
output: 'pantheon-desktop-shell-protocol.c',
)

pantheon_desktop_shell_dep = declare_dependency(
dependencies: [
meson.get_compiler('vala').find_library('pantheon-desktop-shell', dirs: meson.current_source_dir()),
dependency('wayland-client'),
],
include_directories: include_directories('.'),
sources: pantheon_desktop_shell_sources
)
155 changes: 155 additions & 0 deletions protocol/pantheon-desktop-shell-v1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="pantheon_shell_v1">
<copyright><![CDATA[
SPDX-FileCopyrightText: 2023 Corentin Noël <tintou@noel.tf>

SPDX-License-Identifier: LGPL-2.1-or-later
]]></copyright>

<interface name="io_elementary_pantheon_shell_v1" version="1">
<description summary="create panel, widget and get more control">
This interface is used by the Pantheon Wayland shell to communicate with
the compositor.
</description>

<request name="get_panel">
<description summary="create a panel surface from a surface">
Create a panel surface from an existing surface.
</description>
<arg name="output" type="new_id" interface="io_elementary_pantheon_panel_v1"/>
<arg name="surface" type="object" interface="wl_surface"/>
</request>

<request name="get_widget">
<description summary="create a widget surface from a surface">
Create a desktop widget surface from an existing surface.
</description>
<arg name="output" type="new_id" interface="io_elementary_pantheon_widget_v1"/>
<arg name="surface" type="object" interface="wl_surface"/>
</request>

<request name="get_extended_behavior">
<description summary="create a desktop-specific surface from a surface">
Create a desktop-specific surface from an existing surface.
</description>
<arg name="output" type="new_id" interface="io_elementary_pantheon_extended_behavior_v1"/>
<arg name="surface" type="object" interface="wl_surface"/>
</request>
</interface>

<interface name="io_elementary_pantheon_panel_v1" version="1">
<request name="destroy" type="destructor"/>

<enum name="anchor">
<description summary="anchor">
The anchor is a placement hint to the compositor.
</description>
<entry name="top" value="0" summary="the top edge of the screen"/>
<entry name="bottom" value="1" summary="the bottom edge of the screen"/>
<entry name="left" value="2" summary="the left edge of the screen"/>
<entry name="right" value="3" summary="the right edge of the screen"/>
</enum>

<enum name="hide_mode">
<description summary="hide mode">
How the shell should handle the window.
</description>
<entry name="never" value="0" summary="make the surface exclusive"/>
<entry name="maximized_focus_window" value="1" summary="hide when the focused window is maximized"/>
<entry name="overlapping_focus_window" value="2" summary="hide when the focused window overlaps the surface"/>
<entry name="overlapping_window" value="3" summary="hide when any window overlaps the surface"/>
<entry name="always" value="4" summary="always hide and only show if requested by the user"/>
</enum>

<request name="set_anchor">
<description summary="set panel edge anchor">
Tell the shell which side of the screen the panel is
located. This is so that new windows do not overlap the panel
and maximized windows maximize properly.
</description>

<arg name="anchor" type="uint" enum="anchor" summary="anchor"/>
</request>

<request name="focus">
<description summary="request keyboard focus">
Request keyboard focus, taking it away from any other window.
Keyboard focus must always be manually be requested and is
- in contrast to normal windows - never automatically granted
by the compositor.
</description>
</request>

<request name="set_size">
<description summary="set size">
The given size is only used for exclusive zones and
collision tracking for auto hide. By default and if set
to -1 the size of the surface is used.
</description>

<arg name="width" type="int"/>
<arg name="height" type="int"/>
</request>

<request name="set_hide_mode">
<description summary="set panel hide mode">
Tell the shell when to hide the panel.
</description>

<arg name="hide_mode" type="uint" enum="hide_mode" summary="hide mode"/>
</request>

<request name="request_visible_in_multitasking_view">
<description summary="request visible in multitasking view">
Tell the shell that the panel would like to be visible in the multitasking view.
</description>
</request>

<request name="add_blur">
<description summary="add blur">
Tell the window manager to add background blur.
</description>

<arg name="left" type="uint"/>
<arg name="right" type="uint"/>
<arg name="top" type="uint"/>
<arg name="bottom" type="uint"/>
<arg name="clip_radius" type="uint"/>
</request>

<request name="remove_blur">
<description summary="remove blur">
Tell the window manager to remove blur that was set in set_blur_region.
</description>
</request>
</interface>

<interface name="io_elementary_pantheon_widget_v1" version="1">
<request name="destroy" type="destructor"/>
</interface>

<interface name="io_elementary_pantheon_extended_behavior_v1" version="1">
<request name="destroy" type="destructor"/>
<request name="set_keep_above">
<description summary="set keep above">
Tell the shell to keep the surface above on all workspaces
</description>
</request>

<request name="make_centered">
<description summary="requests to keep the surface centered">
Request to keep the surface centered. This will cause keyboard focus
to not be granted automatically but having to be requested via focus.
</description>
</request>

<request name="focus">
<description summary="request keyboard focus">
Request keyboard focus, taking it away from any other window.
Keyboard focus must always be manually be requested and is
- in contrast to normal windows - never automatically granted
by the compositor.
</description>
</request>
</interface>
</protocol>
1 change: 1 addition & 0 deletions protocol/pantheon-desktop-shell.deps
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wayland-client
75 changes: 75 additions & 0 deletions protocol/pantheon-desktop-shell.vapi
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Copyright 2023 elementary, Inc. <https://elementary.io>
* Copyright 2023 Corentin Noël <tintou@noel.tf>
* SPDX-License-Identifier: GPL-3.0-or-later
*/

namespace Pantheon.Desktop {
[CCode (cheader_filename = "pantheon-desktop-shell-client-protocol.h", cname = "struct io_elementary_pantheon_shell_v1", cprefix = "io_elementary_pantheon_shell_v1_")]
public class Shell : Wl.Proxy {
[CCode (cheader_filename = "pantheon-desktop-shell-client-protocol.h", cname = "io_elementary_pantheon_shell_v1_interface")]
public static Wl.Interface iface;
public void set_user_data (void* user_data);
public void* get_user_data ();
public uint32 get_version ();
public void destroy ();
public Pantheon.Desktop.Panel get_panel (Wl.Surface surface);
public Pantheon.Desktop.Widget get_widget (Wl.Surface surface);
public Pantheon.Desktop.ExtendedBehavior get_extended_behavior (Wl.Surface surface);

}
[CCode (cheader_filename = "pantheon-desktop-shell-client-protocol.h", cname = "enum io_elementary_pantheon_panel_v1_anchor", cprefix="IO_ELEMENTARY_PANTHEON_PANEL_V1_ANCHOR_", has_type_id = false)]
public enum Anchor {
TOP,
BOTTOM,
LEFT,
RIGHT,
}

[CCode (cheader_filename = "pantheon-desktop-shell-client-protocol.h", cname = "enum io_elementary_pantheon_panel_v1_hide_mode", cprefix="IO_ELEMENTARY_PANTHEON_PANEL_V1_HIDE_MODE_", has_type_id = false)]
public enum HideMode {
NEVER,
MAXIMIZED_FOCUS_WINDOW,
OVERLAPPING_FOCUS_WINDOW,
OVERLAPPING_WINDOW,
ALWAYS
}

[CCode (cheader_filename = "pantheon-desktop-shell-client-protocol.h", cname = "struct io_elementary_pantheon_panel_v1", cprefix = "io_elementary_pantheon_panel_v1_")]
public class Panel : Wl.Proxy {
[CCode (cheader_filename = "pantheon-desktop-shell-client-protocol.h", cname = "io_elementary_pantheon_panel_v1_interface")]
public static Wl.Interface iface;
public void set_user_data (void* user_data);
public void* get_user_data ();
public uint32 get_version ();
public void destroy ();
public void set_anchor (Pantheon.Desktop.Anchor anchor);
public void focus ();
public void set_size (int width, int height);
public void set_hide_mode (Pantheon.Desktop.HideMode hide_mode);
public void request_visible_in_multitasking_view ();
public void add_blur (uint left, uint right, uint top, uint bottom, uint clip_radius);
public void remove_blur ();
}

[CCode (cheader_filename = "pantheon-desktop-shell-client-protocol.h", cname = "struct io_elementary_pantheon_widget_v1", cprefix = "io_elementary_pantheon_widget_v1_")]
public class Widget : Wl.Proxy {
[CCode (cheader_filename = "pantheon-desktop-shell-client-protocol.h", cname = "io_elementary_pantheon_widget_v1_interface")]
public static Wl.Interface iface;
public void set_user_data (void* user_data);
public void* get_user_data ();
public uint32 get_version ();
public void destroy ();
}

[CCode (cheader_filename = "pantheon-desktop-shell-client-protocol.h", cname = "struct io_elementary_pantheon_extended_behavior_v1", cprefix = "io_elementary_pantheon_extended_behavior_v1_")]
public class ExtendedBehavior : Wl.Proxy {
[CCode (cheader_filename = "pantheon-desktop-shell-client-protocol.h", cname = "io_elementary_pantheon_extended_behavior_v1_interface")]
public static Wl.Interface iface;
public void set_user_data (void* user_data);
public void* get_user_data ();
public uint32 get_version ();
public void destroy ();
public void set_keep_above ();
}
}
Loading