diff --git a/protocol/phosh-mobile-shell.xml b/protocol/phosh-mobile-shell.xml deleted file mode 100644 index 2af4c2e3a31c4f7126202497e1c8470b23771536..0000000000000000000000000000000000000000 --- a/protocol/phosh-mobile-shell.xml +++ /dev/null @@ -1,151 +0,0 @@ -<protocol name="phosh_desktop"> - <interface name="phosh_mobile_shell" version="1"> - <description summary="panel menus and helpers"> - Private protocol between phosh and the compositor. Similar to weston's desktop-shell - protocol. - </description> - - <request name="set_background"> - <arg name="output" type="object" interface="wl_output"/> - <arg name="surface" type="object" interface="wl_surface"/> - </request> - - <request name="set_panel"> - <arg name="output" type="object" interface="wl_output"/> - <arg name="surface" type="object" interface="wl_surface"/> - </request> - - <request name="set_lock_surface"> - <arg name="surface" type="object" interface="wl_surface"/> - </request> - - <request name="unlock"/> - - <request name="set_grab_surface"> - <description summary="set grab surface"> - The surface set by this request will receive a fake - pointer.enter event during grabs at position 0, 0 and is - expected to set an appropriate cursor image as described by - the grab_cursor event sent just before the enter event. - </description> - <arg name="surface" type="object" interface="wl_surface"/> - </request> - - <!-- We'll fold most of wl_shell into this interface and then - they'll share the configure event. --> - <event name="configure"> - <arg name="edges" type="uint"/> - <arg name="surface" type="object" interface="wl_surface"/> - <arg name="width" type="int"/> - <arg name="height" type="int"/> - </event> - - <event name="prepare_lock_surface"> - <description summary="tell the client to create, set the lock surface"> - Tell the client we want it to create and set the lock surface, which is - a GUI asking the user to unlock the screen. The lock surface is - announced with 'set_lock_surface'. Whether or not the client actually - implements locking, it MUST send 'unlock' request to let the normal - desktop resume. - </description> - </event> - - <event name="grab_cursor"> - <description summary="tell client what cursor to show during a grab"> - This event will be sent immediately before a fake enter event on the - grab surface. - </description> - <arg name="cursor" type="uint"/> - </event> - - <enum name="cursor"> - <entry name="none" value="0"/> - - <entry name="resize_top" value="1"/> - <entry name="resize_bottom" value="2"/> - - <entry name="arrow" value="3"/> - - <entry name="resize_left" value="4"/> - <entry name="resize_top_left" value="5"/> - <entry name="resize_bottom_left" value="6"/> - - <entry name="move" value="7"/> - - <entry name="resize_right" value="8"/> - <entry name="resize_top_right" value="9"/> - <entry name="resize_bottom_right" value="10"/> - - <entry name="busy" value="11"/> - </enum> - - <request name="desktop_ready"> - <description summary="desktop is ready to be shown"> - Tell the server, that enough desktop elements have been drawn - to make the desktop look ready for use. During start-up, the - server can wait for this request with a black screen before - starting to fade in the desktop, for instance. If the client - parts of a desktop take a long time to initialize, we avoid - showing temporary garbage. - </description> - </request> - - <enum name="panel_position"> - <entry name="top" value="0"/> - <entry name="bottom" value="1"/> - <entry name="left" value="2"/> - <entry name="right" value="3"/> - </enum> - - <enum name="error"> - <entry name="invalid_argument" value="0" - summary="an invalid argument was provided in a request"/> - </enum> - - <request name="set_panel_position"> - <description summary="set panel position"> - 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="position" type="uint"/> - </request> - - <!-- On top of weston's protocol --> - <request name="set_panel_menu"> - <description summary="set panel menu"> - Add a menu to the panel. Multiple menus can be added. - </description> - <arg name="menu" type="object" interface="wl_surface"/> - </request> - - <request name="show_panel_menu"> - <arg name="menu" type="object" interface="wl_surface"/> - </request> - - <request name="hide_panel_menu"> - <arg name="menu" type="object" interface="wl_surface"/> - </request> - - <enum name="menu_position"> - <!-- only supported for top panels --> - <entry name="left" value="0"/> - <entry name="right" value="1"/> - </enum> - - <request name="set_menu_position"> - <arg name="surface" type="object" interface="wl_surface"/> - <arg name="position" type="uint"/> - </request> - - <!-- only one display for now --> - <request name="rotate_display"> - <description summary="rotate display"> - Rotate the display clockwise 0, 90, 180 or 270 degree. - </description> - <arg name="surface" type="object" interface="wl_surface"/> - <arg name="degree" type="uint"/> - </request> - </interface> -</protocol> diff --git a/protocol/phosh-private.xml b/protocol/phosh-private.xml new file mode 100644 index 0000000000000000000000000000000000000000..79b9b9b0d55952d9fa1b12c349c6b247b5151b0e --- /dev/null +++ b/protocol/phosh-private.xml @@ -0,0 +1,21 @@ +<protocol name="phosh"> + <interface name="phosh_private" version="1"> + <description summary="Phone shell extensions"> + Private protocol between phosh and the compositor. + </description> + + <enum name="error"> + <entry name="invalid_argument" value="0" + summary="an invalid argument was provided in a request"/> + </enum> + + <!-- only one display for now --> + <request name="rotate_display"> + <description summary="rotate display"> + Rotate the display clockwise 0, 90, 180 or 270 degree. + </description> + <arg name="surface" type="object" interface="wl_surface"/> + <arg name="degree" type="uint"/> + </request> + </interface> +</protocol> diff --git a/src/meson.build b/src/meson.build index 673283f5e2e9b4a19ef0423ea3de8c88405ca4a9..4ab6cf6e2a2ebb0a42f739c21e312ae6293a1d52 100644 --- a/src/meson.build +++ b/src/meson.build @@ -20,7 +20,7 @@ phosh_resources = gnome.compile_resources( wl_protos = [ '/'.join([wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml']), '../protocol/idle.xml', - '../protocol/phosh-mobile-shell.xml', + '../protocol/phosh-private.xml', '../protocol/wlr-input-inhibitor-unstable-v1.xml', '../protocol/wlr-layer-shell-unstable-v1.xml', ] diff --git a/src/phosh.c b/src/phosh.c index 63b6e2f5d54ab1663a9f40011d26de2b6fe2311d..260223cf25359ecaa0b0ce1c0afe33b68dade864 100644 --- a/src/phosh.c +++ b/src/phosh.c @@ -19,7 +19,7 @@ #include "config.h" #include "idle-client-protocol.h" -#include "phosh-mobile-shell-client-protocol.h" +#include "phosh-private-client-protocol.h" #include "wlr-layer-shell-unstable-v1-client-protocol.h" #include "wlr-input-inhibitor-unstable-v1-client-protocol.h" @@ -50,7 +50,7 @@ typedef struct { struct wl_display *display; struct wl_registry *registry; - struct phosh_mobile_shell *mshell; + struct phosh_private *mshell; struct zwlr_layer_shell_v1 *layer_shell; struct org_kde_kwin_idle *idle_manager; struct zwlr_input_inhibit_manager_v1 *input_inhibit_manager; @@ -435,15 +435,10 @@ registry_handle_global (void *data, PhoshShell *self = data; PhoshShellPrivate *priv = phosh_shell_get_instance_private (self); -#if 0 /* still needed for rotation */ - if (!strcmp (interface, "phosh_mobile_shell")) { + if (!strcmp (interface, "phosh_private")) { priv->mshell = wl_registry_bind (registry, name, - &phosh_mobile_shell_interface, MIN(version, 1)); - phosh_mobile_shell_add_listener (priv->mshell, &mshell_listener, self); - phosh_mobile_shell_set_user_data (priv->mshell, self); - } -#endif - if (!strcmp (interface, zwlr_layer_shell_v1_interface.name)) { + &phosh_private_interface, 1); + } else if (!strcmp (interface, zwlr_layer_shell_v1_interface.name)) { priv->layer_shell = wl_registry_bind (registry, name, &zwlr_layer_shell_v1_interface, 1); } else if (!strcmp (interface, "wl_output")) { @@ -548,12 +543,15 @@ phosh_shell_constructed (GObject *object) /* Wait until we have been notified about the compositor, * shell, and shell helper objects */ - if (!priv->output || !priv->layer_shell || !priv->idle_manager || !priv->input_inhibit_manager) + if (!priv->output || !priv->layer_shell || !priv->idle_manager || + !priv->input_inhibit_manager || !priv->mshell) wl_display_roundtrip (priv->display); - if (!priv->output || !priv->layer_shell || !priv->idle_manager || !priv->input_inhibit_manager) { + if (!priv->output || !priv->layer_shell || !priv->idle_manager || + !priv->input_inhibit_manager || !priv->mshell) { g_error ("Could not find needed globals\n" - "output: %p, layer_shell: %p, seat: %p, inhibit: %p\n", - priv->output, priv->mshell, priv->idle_manager, priv->input_inhibit_manager); + "output: %p, layer_shell: %p, mshell: %p, seat: %p, inhibit: %p\n", + priv->output, priv->layer_shell, priv->mshell, priv->idle_manager, + priv->input_inhibit_manager); } env_setup (); @@ -607,11 +605,9 @@ phosh_shell_rotate_display (PhoshShell *self, PhoshShellPrivate *priv = phosh_shell_get_instance_private (self); priv->rotation = degree; -#if 0 - phosh_mobile_shell_rotate_display (priv->mshell, - priv->panel->wl_surface, - degree); -#endif + phosh_private_rotate_display (priv->mshell, + priv->panel->wl_surface, + degree); g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_SHELL_PROP_ROTATION]); } diff --git a/src/settings.c b/src/settings.c index df06a6ef2791abe488305049a8963f68aaf187d7..6076eb791bb8207a9498483b692acfc621e16d58 100644 --- a/src/settings.c +++ b/src/settings.c @@ -116,6 +116,8 @@ phosh_settings_constructed (GObject *object) priv->adj_volume = gtk_adjustment_new (0, 0, 100, 1, 10, 10); gtk_range_set_adjustment (GTK_RANGE (priv->scale_volume), priv->adj_volume); + if (phosh_shell_get_rotation (phosh())) + gtk_switch_set_active (GTK_SWITCH (priv->btn_rotation), TRUE); g_signal_connect (priv->btn_rotation, "notify::active", G_CALLBACK (rotation_changed_cb),