[maemo-commits] [maemo-commits] r18250 - in projects/haf/trunk/matchbox-window-manager/matchbox-window-manager: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue May 5 21:59:55 EEST 2009
Author: tthurman
Date: 2009-05-05 21:59:52 +0300 (Tue, 05 May 2009)
New Revision: 18250

Modified:
   projects/haf/trunk/matchbox-window-manager/matchbox-window-manager/ChangeLog
   projects/haf/trunk/matchbox-window-manager/matchbox-window-manager/src/dialog_client.c
Log:
2009-05-05  Thomas Thurman  <thomas.thurman at collabora.co.uk>

        * src/dialog_client.c:
        Remove restrictions on urgent dialogs so that they get placed
        and decorated.  Closes #106529.



Modified: projects/haf/trunk/matchbox-window-manager/matchbox-window-manager/ChangeLog
===================================================================
--- projects/haf/trunk/matchbox-window-manager/matchbox-window-manager/ChangeLog	2009-05-05 18:43:08 UTC (rev 18249)
+++ projects/haf/trunk/matchbox-window-manager/matchbox-window-manager/ChangeLog	2009-05-05 18:59:52 UTC (rev 18250)
@@ -1,3 +1,9 @@
+2009-05-05  Thomas Thurman  <thomas.thurman at collabora.co.uk>
+
+        * src/dialog_client.c:
+        Remove restrictions on urgent dialogs so that they get placed
+        and decorated.  Closes #106529.
+        
 2009-04-22  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
 
 	* src/wm.c (wm_set_cursor_visibility): Comment out XFixes code since

Modified: projects/haf/trunk/matchbox-window-manager/matchbox-window-manager/src/dialog_client.c
===================================================================
--- projects/haf/trunk/matchbox-window-manager/matchbox-window-manager/src/dialog_client.c	2009-05-05 18:43:08 UTC (rev 18249)
+++ projects/haf/trunk/matchbox-window-manager/matchbox-window-manager/src/dialog_client.c	2009-05-05 18:59:52 UTC (rev 18250)
@@ -24,6 +24,7 @@
 static void dialog_client_drag(Client *c);
 static void _get_mouse_position(Wm *w, int *x, int *y);
 
+
 Client*
 dialog_client_new(Wm *w, Window win, Client *trans)
 {
@@ -73,18 +74,6 @@
       return;
     }
 
-  if (c->flags & CLIENT_HAS_URGENCY_FLAG
-      && theme_has_message_decor(c->wm->mbtheme))
-    {
-      *s = theme_frame_defined_height_get(c->wm->mbtheme, 
-				       FRAME_MSG_SOUTH);
-      *e = theme_frame_defined_width_get(c->wm->mbtheme, 
-					 FRAME_MSG_EAST );
-      *w = theme_frame_defined_width_get(c->wm->mbtheme, 
-					 FRAME_MSG_WEST );
-      return;
-    }
-
    *s = theme_frame_defined_height_get(c->wm->mbtheme, 
 				       FRAME_DIALOG_SOUTH);
    *e = theme_frame_defined_width_get(c->wm->mbtheme, 
@@ -189,12 +178,6 @@
   if (c->flags & CLIENT_TITLE_HIDDEN_FLAG)
     return 0;
   
-  if (c->flags & CLIENT_HAS_URGENCY_FLAG 
-      && theme_has_message_decor(w->mbtheme))
-    {
-      return theme_frame_defined_height_get(c->wm->mbtheme, FRAME_MSG);
-    }
-  
   if (c->flags & CLIENT_BORDERS_ONLY_FLAG)
     {
       if (theme_has_borders_only_decor (c->wm->mbtheme))
@@ -272,8 +255,8 @@
        * - raise ourselves above 
        */
       Client *lowest_trans = c->trans;
-      int urgent_flag = 0; /* (c->flags & CLIENT_HAS_URGENCY_FLAG) ?
-			      CLIENT_HAS_URGENCY_FLAG : 0; */
+      int urgent_flag = (c->flags & CLIENT_HAS_URGENCY_FLAG) ?
+	                 CLIENT_HAS_URGENCY_FLAG : 0;
 
       while (lowest_trans->trans != NULL) 
 	lowest_trans = lowest_trans->trans;
@@ -398,7 +381,8 @@
 	 {
 	   c->frame = c->window;
 	 }
-       else c->frame = XCreateWindow(w->dpy, 
+       else {
+	 c->frame = XCreateWindow(w->dpy, 
 				     w->root, 
 				     0, 0,
 				     c->width + offset_east + offset_west, 
@@ -415,6 +399,8 @@
 #endif
 				     attr_mask,
 				     &attr);
+
+       }
      }
 
    if (!(c->flags & CLIENT_TITLE_HIDDEN_FLAG))
@@ -486,8 +472,7 @@
 {
   Wm *w = c->wm;
 
-  if (c->flags & CLIENT_TITLE_HIDDEN_FLAG 
-      || c->flags & CLIENT_HAS_URGENCY_FLAG)
+  if (c->flags & CLIENT_TITLE_HIDDEN_FLAG)
     {
       /* Decorationless dialogs can position themselves anywhere */
       *y = 0; *x = 0; *height = w->dpy_height; *width = w->dpy_width;
@@ -548,7 +533,6 @@
       dbg("%s() (toolbar) offsets south is %i\n", 
 	  __func__, wm_get_offsets_size(w, SOUTH, NULL, True));
 
-
     }
 }
 
@@ -581,10 +565,6 @@
   if (w->config->dialog_stratergy == WM_DIALOGS_STRATERGY_FREE)
     return True;
 
-  /* Allow urgent dialogs to position themselves anywhere */
-  if (c->flags & CLIENT_HAS_URGENCY_FLAG)
-    return True;
-
   /* Decorationless dialogs position anywhere */
   if (c->flags & CLIENT_TITLE_HIDDEN_FLAG)
     return True;
@@ -732,23 +712,6 @@
       break;
     }
 
-  /* Message Dialogs are free to postion/size where ever but can use totally  
-   * offscreen request to position to window corners - see below
-   */
-  if (c->flags & CLIENT_HAS_URGENCY_FLAG)
-    {
-      int win_width  = c->width + bdr_east;
-      int win_height = c->height + bdr_south;
-
-      if (c->x >= w->dpy_width) 
-	c->x = w->dpy_width - win_width - (c->x - w->dpy_width );
-
-      if (c->y >= w->dpy_height) 
-	c->y = w->dpy_height - win_height - (c->y - w->dpy_height );
-
-      return;
-    }
-
   /* save values for possible resizing later if more space comes available */
   c->init_width  = c->width;
   c->init_height = c->height;
@@ -783,11 +746,13 @@
     }
 
   /* horiz contarined mode - force dialog to be full width*/
-  if (c->wm->config->dialog_stratergy == WM_DIALOGS_STRATERGY_CONSTRAINED_HORIZ
-      && !(c->flags & CLIENT_TITLE_HIDDEN_FLAG) )
+  /* but hacked by tthurman to happen in all modes */
+  if (!(c->flags & CLIENT_TITLE_HIDDEN_FLAG) )
     {
       c->x     = avail_x + bdr_west;
       c->width = avail_width - (bdr_east + bdr_west);
+
+      c->y = w->dpy_height - c->height;
     }
 }
 
@@ -873,8 +838,7 @@
 		    total_w, offset_south); 
 
   /* We dont paint buttons for borderonly and message dialogs */
-  if (!(c->flags & CLIENT_BORDERS_ONLY_FLAG
-	|| c->flags & CLIENT_HAS_URGENCY_FLAG))
+  if (!(c->flags & CLIENT_BORDERS_ONLY_FLAG))
     {
       theme_frame_button_paint(c->wm->mbtheme, c, 
 			       BUTTON_ACTION_CLOSE, 
@@ -1041,10 +1005,7 @@
 	     *       this.
 	     *       Is it safe to simply remove the server grab ?
 	     *
-	     */
-	    if (c->flags & CLIENT_HAS_URGENCY_FLAG)
-	      return; 		/* No Effect for message wins */
-	    
+	     */	    
 	    if (e->window != c->frames_decor[NORTH])
 	      return;
 	    


More information about the maemo-commits mailing list