~ubuntu-branches/ubuntu/precise/gnome-control-center/precise-updates

« back to all changes in this revision

Viewing changes to debian/patches/05_display_capplet_label_focus.patch

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-03-17 14:49:32 UTC
  • Revision ID: james.westby@ubuntu.com-20110317144932-etu0gy58qzfgp30e
Tags: 1:2.32.1-0ubuntu10
* debian/control:
  - Bump build-depends on libgnome-desktop-dev to use patched version that
    supports toggling of monitor labels
* debian/patches/05_display_capplet_label_focus.patch:
  - Only show monitor labels when display applet has focus (LP: #403840)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Only show monitor labels when display applet has focus
 
2
Author: Robert Ancell <robert.ancell@canonical.com>
 
3
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=589562
 
4
Bug-Ubuntu: https://bugs.launchpad.net/bugs/403840
 
5
 
 
6
Index: gnome-control-center-2.32.1/capplets/display/xrandr-capplet.c
 
7
===================================================================
 
8
--- gnome-control-center-2.32.1.orig/capplets/display/xrandr-capplet.c  2011-03-17 14:49:29.717410905 +1100
 
9
+++ gnome-control-center-2.32.1/capplets/display/xrandr-capplet.c       2011-03-17 14:49:27.167397090 +1100
 
10
@@ -149,6 +149,8 @@
 
11
     }
 
12
 
 
13
     app->labeler = gnome_rr_labeler_new (app->current_configuration);
 
14
+       if (gtk_widget_has_focus (app->dialog))
 
15
+               gnome_rr_labeler_show (app->labeler);
 
16
 
 
17
     select_current_output_from_dialog_position (app);
 
18
 }
 
19
@@ -2312,6 +2314,26 @@
 
20
     return FALSE;
 
21
 }
 
22
 
 
23
+static gboolean
 
24
+dialog_focus_in_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
 
25
+{
 
26
+    App *app = data;
 
27
+
 
28
+       if (app->labeler)
 
29
+               gnome_rr_labeler_show (app->labeler);
 
30
+    return FALSE;
 
31
+}
 
32
+
 
33
+static gboolean
 
34
+dialog_focus_out_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
 
35
+{
 
36
+    App *app = data;
 
37
+
 
38
+       if (app->labeler)
 
39
+               gnome_rr_labeler_hide (app->labeler);
 
40
+    return FALSE;
 
41
+}
 
42
+
 
43
 static void
 
44
 hide_help_button (App *app)
 
45
 {
 
46
@@ -2466,6 +2488,10 @@
 
47
     app->dialog = _gtk_builder_get_widget (builder, "dialog");
 
48
     g_signal_connect_after (app->dialog, "map-event",
 
49
                            G_CALLBACK (dialog_map_event_cb), app);
 
50
+    g_signal_connect_after (app->dialog, "focus-in-event",
 
51
+                           G_CALLBACK (dialog_focus_in_cb), app);
 
52
+    g_signal_connect_after (app->dialog, "focus-out-event",
 
53
+                           G_CALLBACK (dialog_focus_out_cb), app);
 
54
 
 
55
     gtk_window_set_default_icon_name ("preferences-desktop-display");
 
56
     gtk_window_set_icon_name (GTK_WINDOW (app->dialog),