[gnome-initial-setup/shell/4765: 309/362] Don't allow window move during keyboard detection



commit 68876dba8541eab9abfc846b073443e258e40bee
Author: Roddy Shuler <roddy endlessm com>
Date:   Mon Dec 15 21:58:16 2014 -0800

    Don't allow window move during keyboard detection
    
    Previously, the user could drag the dialog title bar
    (or hold the super key and drag anywhere on the dialog)
    and move the entire initial setup window off-screen.
    
    [endlessm/eos-shell#3425]

 .../pages/keyboard/gis-keyboard-page.c             |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c 
b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
index f95619e..6cf2d35 100644
--- a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
+++ b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
@@ -986,6 +986,20 @@ detector_response (GtkDialog *detector, gint response_id, gpointer data)
 }
 
 static void
+detector_realize (GtkDialog *detector, gpointer data)
+{
+  GisKeyboardPage *self = data;
+  GdkWindow *window = gtk_widget_get_window (GTK_WIDGET (detector));
+  /* disable all the WM functions */
+  gdk_window_set_functions (window, GDK_FUNC_ALL
+                            | GDK_FUNC_RESIZE
+                            | GDK_FUNC_MOVE
+                            | GDK_FUNC_MINIMIZE
+                            | GDK_FUNC_MAXIMIZE
+                            | GDK_FUNC_CLOSE);
+}
+
+static void
 show_keyboard_detector (GisKeyboardPage *self)
 {
   GisKeyboardPagePrivate *priv = gis_keyboard_page_get_instance_private (self);
@@ -995,6 +1009,7 @@ show_keyboard_detector (GisKeyboardPage *self)
   toplevel = gtk_widget_get_toplevel (GTK_WIDGET (self));
   detector = cc_keyboard_query_new (GTK_WINDOW (toplevel), priv->xkb_info);
   g_signal_connect (detector, "response", G_CALLBACK (detector_response), self);
+  g_signal_connect (detector, "realize", G_CALLBACK (detector_realize), self);
   cc_keyboard_query_run (CC_KEYBOARD_QUERY (detector));
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]