Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
P
phosh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Guido Gunther
phosh
Commits
4796de2b
Commit
4796de2b
authored
Apr 18, 2018
by
Guido Gunther
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bring back rotation via private protocol
parent
a71c39b8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
171 deletions
+39
-171
protocol/phosh-mobile-shell.xml
protocol/phosh-mobile-shell.xml
+0
-151
protocol/phosh-private.xml
protocol/phosh-private.xml
+21
-0
src/meson.build
src/meson.build
+1
-1
src/phosh.c
src/phosh.c
+15
-19
src/settings.c
src/settings.c
+2
-0
No files found.
protocol/phosh-mobile-shell.xml
deleted
100644 → 0
View file @
a71c39b8
<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>
protocol/phosh-private.xml
0 → 100644
View file @
4796de2b
<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>
src/meson.build
View file @
4796de2b
...
...
@@ -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',
]
...
...
src/phosh.c
View file @
4796de2b
...
...
@@ -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
]);
}
...
...
src/settings.c
View file @
4796de2b
...
...
@@ -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
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment