Merge lp:~robert-ancell/lightdm/usc-hardware-cursor into lp:lightdm

Proposed by kevin gunn
Status: Merged
Merged at revision: 1946
Proposed branch: lp:~robert-ancell/lightdm/usc-hardware-cursor
Merge into: lp:lightdm
Diff against target: 178 lines (+35/-9)
9 files modified
src/seat-xlocal.c (+2/-0)
src/unity-system-compositor.c (+21/-4)
src/unity-system-compositor.h (+2/-0)
tests/scripts/mir-autologin.conf (+1/-1)
tests/scripts/mir-greeter.conf (+1/-1)
tests/scripts/mir-session-compositor-crash.conf (+1/-1)
tests/scripts/mir-session-crash.conf (+1/-1)
tests/scripts/mir-session.conf (+1/-1)
tests/src/unity-system-compositor.c (+5/-0)
To merge this branch: bzr merge lp:~robert-ancell/lightdm/usc-hardware-cursor
Reviewer Review Type Date Requested Status
Andreas Pokorny (community) Approve
Robert Ancell Approve
PS Jenkins bot continuous-integration Approve
Stephen M. Webb (community) Approve
Review via email: mp+213897@code.launchpad.net

Commit message

enable use of hw cursor

Description of the change

use of hw cursor, needed for unty8 desktop preview

To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) wrote :

This has been tested successfully in PPA.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) wrote :

I approve this code that I wrote :)

Stephen confirmed that u-s-c will run before it supports this arg, so can land now.

review: Approve
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

works, tested the ppa.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/seat-xlocal.c'
2--- src/seat-xlocal.c 2014-02-08 09:33:33 +0000
3+++ src/seat-xlocal.c 2014-04-02 17:51:29 +0000
4@@ -206,6 +206,8 @@
5 unity_system_compositor_set_socket (compositor, socket_name);
6 g_free (socket_name);
7
8+ unity_system_compositor_set_enable_hardware_cursor (compositor, TRUE);
9+
10 return DISPLAY_SERVER (compositor);
11 }
12
13
14=== modified file 'src/unity-system-compositor.c'
15--- src/unity-system-compositor.c 2014-03-07 03:47:07 +0000
16+++ src/unity-system-compositor.c 2014-04-02 17:51:29 +0000
17@@ -39,6 +39,9 @@
18 gint vt;
19 gboolean have_vt_ref;
20
21+ /* TRUE if should show hardware cursor */
22+ gboolean enable_hardware_cursor;
23+
24 /* Pipes to communicate with compositor */
25 int to_compositor_pipe[2];
26 int from_compositor_pipe[2];
27@@ -118,6 +121,13 @@
28 }
29
30 void
31+unity_system_compositor_set_enable_hardware_cursor (UnitySystemCompositor *compositor, gboolean enable_cursor)
32+{
33+ g_return_if_fail (compositor != NULL);
34+ compositor->priv->enable_hardware_cursor = enable_cursor;
35+}
36+
37+void
38 unity_system_compositor_set_timeout (UnitySystemCompositor *compositor, gint timeout)
39 {
40 g_return_if_fail (compositor != NULL);
41@@ -357,7 +367,8 @@
42 {
43 UnitySystemCompositor *compositor = UNITY_SYSTEM_COMPOSITOR (server);
44 gboolean result;
45- gchar *dir, *log_file, *command, *absolute_command, *value;
46+ GString *command;
47+ gchar *dir, *log_file, *absolute_command, *value;
48
49 g_return_val_if_fail (compositor->priv->process == NULL, FALSE);
50
51@@ -410,10 +421,16 @@
52 l_debug (compositor, "Can't launch compositor %s, not found in path", compositor->priv->command);
53 return FALSE;
54 }
55- command = g_strdup_printf ("%s --file '%s' --from-dm-fd %d --to-dm-fd %d --vt %d", absolute_command, compositor->priv->socket, compositor->priv->to_compositor_pipe[0], compositor->priv->from_compositor_pipe[1], compositor->priv->vt);
56- process_set_command (compositor->priv->process, command);
57- g_free (command);
58+ command = g_string_new (absolute_command);
59 g_free (absolute_command);
60+ g_string_append_printf (command, " --file '%s'", compositor->priv->socket);
61+ g_string_append_printf (command, " --from-dm-fd %d --to-dm-fd %d", compositor->priv->to_compositor_pipe[0], compositor->priv->from_compositor_pipe[1]);
62+ if (compositor->priv->vt > 0)
63+ g_string_append_printf (command, " --vt %d", compositor->priv->vt);
64+ if (compositor->priv->enable_hardware_cursor)
65+ g_string_append (command, " --enable-hardware-cursor=true");
66+ process_set_command (compositor->priv->process, command->str);
67+ g_string_free (command, TRUE);
68
69 /* Start the compositor */
70 g_signal_connect (compositor->priv->process, "stopped", G_CALLBACK (stopped_cb), compositor);
71
72=== modified file 'src/unity-system-compositor.h'
73--- src/unity-system-compositor.h 2013-12-11 00:05:31 +0000
74+++ src/unity-system-compositor.h 2014-04-02 17:51:29 +0000
75@@ -48,6 +48,8 @@
76
77 void unity_system_compositor_set_vt (UnitySystemCompositor *compositor, gint vt);
78
79+void unity_system_compositor_set_enable_hardware_cursor (UnitySystemCompositor *compositor, gboolean enable_cursor);
80+
81 void unity_system_compositor_set_timeout (UnitySystemCompositor *compositor, gint timeout);
82
83 void unity_system_compositor_set_active_session (UnitySystemCompositor *compositor, const gchar *id);
84
85=== modified file 'tests/scripts/mir-autologin.conf'
86--- tests/scripts/mir-autologin.conf 2014-03-17 18:33:02 +0000
87+++ tests/scripts/mir-autologin.conf 2014-04-02 17:51:29 +0000
88@@ -10,7 +10,7 @@
89 #?RUNNER DAEMON-START
90
91 # System compositor starts
92-#?UNITY-SYSTEM-COMPOSITOR START FILE=/tmp/lightdm-mir-0 VT=7 XDG_VTNR=7
93+#?UNITY-SYSTEM-COMPOSITOR START FILE=/tmp/lightdm-mir-0 VT=7 ENABLE-HARDWARE-CURSOR=TRUE XDG_VTNR=7
94 #?*UNITY-SYSTEM-COMPOSITOR READY
95
96 # Session starts
97
98=== modified file 'tests/scripts/mir-greeter.conf'
99--- tests/scripts/mir-greeter.conf 2014-03-17 18:33:02 +0000
100+++ tests/scripts/mir-greeter.conf 2014-04-02 17:51:29 +0000
101@@ -6,7 +6,7 @@
102 #?RUNNER DAEMON-START
103
104 # System compositor starts
105-#?UNITY-SYSTEM-COMPOSITOR START FILE=/tmp/lightdm-mir-0 VT=7 XDG_VTNR=7
106+#?UNITY-SYSTEM-COMPOSITOR START FILE=/tmp/lightdm-mir-0 VT=7 ENABLE-HARDWARE-CURSOR=TRUE XDG_VTNR=7
107 #?*UNITY-SYSTEM-COMPOSITOR READY
108
109 # Greeter starts
110
111=== modified file 'tests/scripts/mir-session-compositor-crash.conf'
112--- tests/scripts/mir-session-compositor-crash.conf 2014-03-17 18:33:02 +0000
113+++ tests/scripts/mir-session-compositor-crash.conf 2014-04-02 17:51:29 +0000
114@@ -10,7 +10,7 @@
115 #?RUNNER DAEMON-START
116
117 # System compositor starts
118-#?UNITY-SYSTEM-COMPOSITOR START FILE=/tmp/lightdm-mir-0 VT=7 XDG_VTNR=7
119+#?UNITY-SYSTEM-COMPOSITOR START FILE=/tmp/lightdm-mir-0 VT=7 ENABLE-HARDWARE-CURSOR=TRUE XDG_VTNR=7
120 #?*UNITY-SYSTEM-COMPOSITOR READY
121
122 # Session starts
123
124=== modified file 'tests/scripts/mir-session-crash.conf'
125--- tests/scripts/mir-session-crash.conf 2014-03-17 18:33:02 +0000
126+++ tests/scripts/mir-session-crash.conf 2014-04-02 17:51:29 +0000
127@@ -10,7 +10,7 @@
128 #?RUNNER DAEMON-START
129
130 # System compositor starts
131-#?UNITY-SYSTEM-COMPOSITOR START FILE=/tmp/lightdm-mir-0 VT=7 XDG_VTNR=7
132+#?UNITY-SYSTEM-COMPOSITOR START FILE=/tmp/lightdm-mir-0 VT=7 ENABLE-HARDWARE-CURSOR=TRUE XDG_VTNR=7
133 #?*UNITY-SYSTEM-COMPOSITOR READY
134
135 # Session starts
136
137=== modified file 'tests/scripts/mir-session.conf'
138--- tests/scripts/mir-session.conf 2014-03-17 18:33:02 +0000
139+++ tests/scripts/mir-session.conf 2014-04-02 17:51:29 +0000
140@@ -30,7 +30,7 @@
141 #?*GREETER-X-0 START-SESSION
142
143 # System compositor starts
144-#?UNITY-SYSTEM-COMPOSITOR START FILE=/tmp/lightdm-mir-0 VT=8 XDG_VTNR=8
145+#?UNITY-SYSTEM-COMPOSITOR START FILE=/tmp/lightdm-mir-0 VT=8 ENABLE-HARDWARE-CURSOR=TRUE XDG_VTNR=8
146 #?*UNITY-SYSTEM-COMPOSITOR READY
147
148 # Switch to system compositor
149
150=== modified file 'tests/src/unity-system-compositor.c'
151--- tests/src/unity-system-compositor.c 2014-02-26 04:14:39 +0000
152+++ tests/src/unity-system-compositor.c 2014-04-02 17:51:29 +0000
153@@ -146,6 +146,7 @@
154 GString *status_text;
155 gboolean test = FALSE;
156 int vt_number = -1;
157+ gboolean enable_hardware_cursor = FALSE;
158 const gchar *file = NULL;
159
160 #if !defined(GLIB_VERSION_2_36)
161@@ -178,6 +179,8 @@
162 vt_number = atoi (argv[i+1]);
163 i++;
164 }
165+ else if (strcmp (arg, "--enable-hardware-cursor=true") == 0)
166+ enable_hardware_cursor = TRUE;
167 else if (strcmp (arg, "--file") == 0)
168 {
169 file = argv[i+1];
170@@ -196,6 +199,8 @@
171 g_string_append_printf (status_text, " FILE=%s", file);
172 if (vt_number >= 0)
173 g_string_append_printf (status_text, " VT=%d", vt_number);
174+ if (enable_hardware_cursor)
175+ g_string_append (status_text, " ENABLE-HARDWARE-CURSOR=TRUE");
176 if (g_getenv ("XDG_VTNR"))
177 g_string_append_printf (status_text, " XDG_VTNR=%s", g_getenv ("XDG_VTNR"));
178 if (test)

Subscribers

People subscribed via source and target branches