Merge lp:~diwic/unity-settings-daemon/lp1287584 into lp:unity-settings-daemon

Proposed by David Henningsson
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 4030
Merged at revision: 4028
Proposed branch: lp:~diwic/unity-settings-daemon/lp1287584
Merge into: lp:unity-settings-daemon
Diff against target: 65 lines (+9/-14)
2 files modified
plugins/media-keys/gsd-media-keys-manager.c (+1/-14)
plugins/media-keys/what-did-you-plug-in/dialog-window.c (+8/-0)
To merge this branch: bzr merge lp:~diwic/unity-settings-daemon/lp1287584
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Sebastien Bacher Approve
Review via email: mp+209213@code.launchpad.net

Commit message

Fix what-did-you-plug-in dialog showing up behind other windows.
Simplify launching of "unity-control-center sound".

Description of the change

Fix what-did-you-plug-in dialog showing up behind other windows.
Simplify launching of "unity-control-center sound".

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the work, some comments though:

- it would be better to not batch unrelated changes in one merge proposal

- enforcing the current timestamp is going to bypass the focus-stealing-prevention, can we get the time from the udev event rather?

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
4030. By David Henningsson

what-did-you-plug-in: Clarify comment in previous commit

Revision history for this message
Sebastien Bacher (seb128) wrote :

ok, discussed on IRC, it's not easy to get the event timestamp and in practice it's not likely an user can plug a device and type at the same time so the hack should be ok

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/media-keys/gsd-media-keys-manager.c'
2--- plugins/media-keys/gsd-media-keys-manager.c 2014-02-24 12:18:42 +0000
3+++ plugins/media-keys/gsd-media-keys-manager.c 2014-03-04 11:30:35 +0000
4@@ -2698,19 +2698,6 @@
5 }
6 }
7
8-
9-static void
10-launch_sound_settings()
11-{
12- if (fork() != 0)
13- return;
14-
15- /* Child process */
16- if (system("unity-control-center sound") == -1)
17- g_warning("Failed to launch sound settings.\n");
18- exit(0);
19-}
20-
21 static void
22 on_wdypi_action (int action, void *userdata)
23 {
24@@ -2721,7 +2708,7 @@
25
26 switch (action) {
27 case WDYPI_DIALOG_SOUND_SETTINGS:
28- launch_sound_settings();
29+ execute(manager, "unity-control-center sound", FALSE);
30 break;
31 case WDYPI_DIALOG_HEADPHONES:
32 pa_backend_set_port(pb, "analog-output-headphones", true);
33
34=== modified file 'plugins/media-keys/what-did-you-plug-in/dialog-window.c'
35--- plugins/media-keys/what-did-you-plug-in/dialog-window.c 2014-02-18 12:19:40 +0000
36+++ plugins/media-keys/what-did-you-plug-in/dialog-window.c 2014-03-04 11:30:35 +0000
37@@ -2,6 +2,7 @@
38 #include <glib/gi18n.h>
39 #include <gtk/gtk.h>
40 #include <gdk-pixbuf/gdk-pixbuf.h>
41+#include <gdk/gdkx.h>
42
43 #include "dialog-window.h"
44
45@@ -82,6 +83,7 @@
46
47 static void dialog_create(dialog_window *d, bool show_headset, bool show_mic)
48 {
49+ guint32 timestamp;
50 d->dialog = gtk_dialog_new();
51 gtk_window_set_title(GTK_WINDOW(d->dialog), _("Unknown Audio Device"));
52 gtk_container_set_border_width(GTK_CONTAINER(d->dialog), 6);
53@@ -117,6 +119,12 @@
54 g_signal_connect(d->dialog, "response", G_CALLBACK(on_response), d);
55
56 gtk_widget_show_all(d->dialog);
57+ /* This event did not originate from a pointer or key movement, so we can't
58+ use GDK_CURRENT_TIME (or just gtk_window_present) here. There is also no
59+ other source timestamp to rely on. Without a timestamp, the dialog would
60+ often show up behind other windows. */
61+ timestamp = gdk_x11_get_server_time(gtk_widget_get_window(GTK_WIDGET(d->dialog)));
62+ gtk_window_present_with_time(GTK_WINDOW(d->dialog), timestamp);
63 }
64
65 void wdypi_dialog_run(bool show_headset, bool show_mic, wdypi_dialog_cb cb, void *cb_userdata)

Subscribers

People subscribed via source and target branches