[maemo-commits] [maemo-commits] r17336 - in projects/haf/trunk/libmatchbox2: . matchbox/core

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Sat Jan 31 16:05:15 EET 2009
Author: kihamala
Date: 2009-01-31 16:05:09 +0200 (Sat, 31 Jan 2009)
New Revision: 17336

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-window-manager.c
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.c
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-root-window.c
Log:
enable "unresponsive application" dialog


Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-01-30 18:24:08 UTC (rev 17335)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-01-31 14:05:09 UTC (rev 17336)
@@ -1,3 +1,18 @@
+2009-01-31  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
+
+	* matchbox/core/mb-wm-root-window.c
+	(mb_wm_root_window_handle_message): Print a line when a ping reply is
+	received (currently this never seems to happen).
+	* matchbox/core/mb-window-manager.c (mb_wm_handle_unmap_notify): If
+	the client unmaps its window and that is being pinged, regard it as
+	responding to the ping.
+	(mb_wm_handle_hang_client): Stop the ping process if it is ongoing.
+	* matchbox/core/mb-wm-client.c (mb_wm_client_ping_timeout_cb): Call
+	mb_wm_handle_hang_client instead of mb_wm_client_shutdown on ping
+	timeout. This way the user can decide whether or not the client should
+	be killed.
+	(mb_wm_client_shutdown): Print debug when we kill a client.
+
 2009-01-29  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
 
 	* matchbox/core/mb-wm-client-base.c

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-window-manager.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-window-manager.c	2009-01-30 18:24:08 UTC (rev 17335)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-window-manager.c	2009-01-31 14:05:09 UTC (rev 17336)
@@ -481,6 +481,19 @@
 
   if (client)
     {
+      if (mb_wm_client_ping_in_progress (client)) 
+        {
+          MBWindowManagerClass  *wm_klass;
+
+	  /* stop ping process since the client closed the window */
+          mb_wm_client_ping_stop (client);
+
+          wm_klass = MB_WINDOW_MANAGER_CLASS (MB_WM_OBJECT_GET_CLASS (wm));
+
+          if (wm_klass->client_responding)
+	    wm_klass->client_responding (wm, client);
+        } 
+
       if (client->skip_unmaps)
 	{
 	  MBWM_DBG ("skipping unmap for %p (skip count %d)\n",
@@ -1857,6 +1870,7 @@
 void
 mb_wm_handle_ping_reply (MBWindowManager * wm, MBWindowManagerClient *c)
 {
+  g_debug ("%s: entered", __FUNCTION__);
   if (c == NULL)
     return;
 
@@ -1887,6 +1901,10 @@
     {
       mb_wm_client_shutdown (c);
     }
+
+  if (mb_wm_client_ping_in_progress (c))
+    /* hung client is now handled, no need for ping process */
+    mb_wm_client_ping_stop (c);
 }
 
 void

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.c	2009-01-30 18:24:08 UTC (rev 17335)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.c	2009-01-31 14:05:09 UTC (rev 17336)
@@ -775,11 +775,13 @@
 }
 
 static Bool
-mb_wm_client_ping_timeout_cb (void * userdata)
+mb_wm_client_ping_timeout_cb (void *userdata)
 {
-  MBWindowManagerClient * client = userdata;
+  MBWindowManagerClient *client = userdata;
+  MBWindowManager *wm = client->wmref;
 
-  mb_wm_client_shutdown (client);
+  g_debug ("%s: entered", __FUNCTION__);
+  mb_wm_handle_hang_client (wm, client);
   return False;
 }
 
@@ -805,6 +807,7 @@
 {
   MBWMMainContext * ctx = client->wmref->main_ctx;
 
+  g_debug ("%s: entered", __FUNCTION__);
   if (!client->ping_cb_id)
     return;
 
@@ -827,11 +830,13 @@
     {
       if (!strcmp (buf, machine))
 	{
+          g_debug ("%s: kill(%u)", __FUNCTION__, pid);
 	  if (kill (pid, sig) >= 0)
 	    return;
 	}
     }
 
+  g_debug ("%s: XKillClient for %lx", __FUNCTION__, xwin);
   XKillClient(wm->xdpy, xwin);
 }
 

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-root-window.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-root-window.c	2009-01-30 18:24:08 UTC (rev 17335)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-root-window.c	2009-01-31 14:05:09 UTC (rev 17336)
@@ -354,6 +354,7 @@
   else if (e->message_type == wm->atoms[MBWM_ATOM_WM_PROTOCOLS]
 	   && e->data.l[0] == wm->atoms[MBWM_ATOM_NET_WM_PING])
     {
+      g_debug ("%s: NET_WM_PING reply for %lx", __FUNCTION__, e->data.l[2]);
       if ((c = mb_wm_managed_client_from_xwindow(wm, e->data.l[2])) != NULL)
 	mb_wm_handle_ping_reply (wm, c);
       return 1;
@@ -395,7 +396,6 @@
 	}
       return 1;
     }
-
   else if (e->message_type == wm->atoms[MBWM_ATOM_WM_CHANGE_STATE])
     {
       switch (e->data.l[0])
@@ -448,6 +448,8 @@
 	   ;
 	 }
     }
+  else
+    g_debug ("%s: unknown ClientMessage", __FUNCTION__);
 
   return 0;
 }


More information about the maemo-commits mailing list