[maemo-commits] [maemo-commits] r12810 - in projects/haf/trunk/hildon-desktop: . libhildondesktop libhildonwm src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Jul 24 16:03:53 EEST 2007
Author: moimart
Date: 2007-07-24 16:03:46 +0300 (Tue, 24 Jul 2007)
New Revision: 12810

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-window.c
   projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c
   projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c
   projects/haf/trunk/hildon-desktop/src/hd-switcher-menu.c
Log:
2007-07-24  Moises Martinez  <moises.martinez at nokia.com>

        * libhildondesktop/hildon-desktop-panel-window.c:
        (hildon_desktop_panel_window_in_focus),
        (hildon_desktop_panel_window_constructor):
        - Ignore focus-in events for panels that can-focus == FALSE
        * libhildonwm/hd-wm.c: (hd_wm_reset_focus):
        - Unset focus for window where others buttons is placed.
        * src/hd-applications-menu.c: (hd_applications_menu_key_press):
        * src/hd-switcher-menu.c:
        (hd_switcher_menu_popup_window_keypress_cb):
        - set toplevel to can-focus
        Fixes: N#63854
	* ChangeLog updated.



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-07-24 12:44:38 UTC (rev 12809)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-07-24 13:03:46 UTC (rev 12810)
@@ -1,3 +1,17 @@
+2007-07-24  Moises Martinez  <moises.martinez at nokia.com>
+
+	* libhildondesktop/hildon-desktop-panel-window.c:
+	(hildon_desktop_panel_window_in_focus),
+	(hildon_desktop_panel_window_constructor):
+	- Ignore focus-in events for panels that can-focus == FALSE
+	* libhildonwm/hd-wm.c: (hd_wm_reset_focus):
+	- Unset focus for window where others buttons is placed.
+	* src/hd-applications-menu.c: (hd_applications_menu_key_press):
+	* src/hd-switcher-menu.c:
+	(hd_switcher_menu_popup_window_keypress_cb):
+	- set toplevel to can-focus
+	Fixes: N#63854
+
 2007-07-24  Lucas Rocha  <lucas.rocha at nokia.com>
 
 	* src/hd-applications-menu.c (hd_applications_menu_init): check if

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-window.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-window.c	2007-07-24 12:44:38 UTC (rev 12809)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-panel-window.c	2007-07-24 13:03:46 UTC (rev 12810)
@@ -394,6 +394,19 @@
     hildon_desktop_panel_win_move_resize (window,TRUE,TRUE);
 }
 
+static gboolean 
+hildon_desktop_panel_window_in_focus (GtkWidget *widget, GdkEventFocus *event, gpointer user_data)
+{
+  gboolean can_focus = FALSE;
+
+  g_object_get (widget, "can-focus", &can_focus, NULL);
+
+  if (can_focus)
+    return FALSE;	  
+
+  return TRUE;
+}	
+
 static GObject *  
 hildon_desktop_panel_window_constructor (GType gtype,
 			                 guint n_params,
@@ -411,7 +424,8 @@
   widget = GTK_WIDGET (object);
   window = HILDON_DESKTOP_PANEL_WINDOW (object);
 
-  
+  g_signal_connect (object, "focus-in-event", G_CALLBACK (hildon_desktop_panel_window_in_focus), NULL); 	  
+ 
   GTK_WINDOW (window)->type = GTK_WINDOW_TOPLEVEL;
 
   gtk_window_set_type_hint (GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_DOCK);

Modified: projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c	2007-07-24 12:44:38 UTC (rev 12809)
+++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm.c	2007-07-24 13:03:46 UTC (rev 12810)
@@ -32,6 +32,8 @@
 #include <dirent.h>
 #include <X11/Xatom.h>
 
+#include <gtk/gtkwindow.h>
+
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 #include <gdk/gdkevents.h>
@@ -2218,7 +2220,7 @@
   {
     hd_wm_debug ("Making TN unfocusable");
     hdwm->priv->has_focus = FALSE;
-    hd_wm_debug ("%s: %d, hn_window_set_focus (tasknav,FALSE);",__FILE__,__LINE__);
+    hd_wm_set_window_focus (GTK_WIDGET (hdwm->priv->all_menu)->window, FALSE);
   }
 }
 

Modified: projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c
===================================================================
--- projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c	2007-07-24 12:44:38 UTC (rev 12809)
+++ projects/haf/trunk/hildon-desktop/src/hd-applications-menu.c	2007-07-24 13:03:46 UTC (rev 12810)
@@ -274,10 +274,13 @@
     }
     else
     {
-      GdkWindow *window = gtk_widget_get_parent_window (button->priv->button);
-     
+      GtkWidget *window = gtk_widget_get_toplevel (button->priv->button);
+      
       gtk_widget_grab_focus (GTK_WIDGET (button->priv->button));
-      hd_wm_activate_window (HD_TN_ACTIVATE_KEY_FOCUS, window);
+      
+      g_object_set (window, "can-focus", TRUE, NULL);
+      
+      hd_wm_activate_window (HD_TN_ACTIVATE_KEY_FOCUS, window->window);
     }
     
     return TRUE;

Modified: projects/haf/trunk/hildon-desktop/src/hd-switcher-menu.c
===================================================================
--- projects/haf/trunk/hildon-desktop/src/hd-switcher-menu.c	2007-07-24 12:44:38 UTC (rev 12809)
+++ projects/haf/trunk/hildon-desktop/src/hd-switcher-menu.c	2007-07-24 13:03:46 UTC (rev 12810)
@@ -342,9 +342,13 @@
     {
       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (switcher->priv->toggle_button), FALSE);
 
-      GdkWindow *window = gtk_widget_get_parent_window (switcher->priv->toggle_button);
+      GtkWidget *window = gtk_widget_get_toplevel (switcher->priv->toggle_button);
+
+      g_object_set (window, "can-focus", TRUE, NULL);
+      
       gtk_widget_grab_focus (GTK_WIDGET (switcher->priv->toggle_button));
-      hd_wm_activate_window (HD_TN_ACTIVATE_KEY_FOCUS,window);
+      
+      hd_wm_activate_window (HD_TN_ACTIVATE_KEY_FOCUS, window->window);
     }
 
     return TRUE;


More information about the maemo-commits mailing list