metacity r3725 - in trunk: . src/compositor



Author: iain
Date: Sat May 24 20:40:12 2008
New Revision: 3725
URL: http://svn.gnome.org/viewvc/metacity?rev=3725&view=rev

Log:
2008-05-24  Iain Holmes  <iain gnome org>

        * src/compositor/compositor-xrender.c: Add Dropdown menu atoms 
so we
        can add shadows to them. Fixes #517442
        Handle tooltips as well. Fixes #517524



Modified:
   trunk/ChangeLog
   trunk/src/compositor/compositor-xrender.c

Modified: trunk/src/compositor/compositor-xrender.c
==============================================================================
--- trunk/src/compositor/compositor-xrender.c	(original)
+++ trunk/src/compositor/compositor-xrender.c	Sat May 24 20:40:12 2008
@@ -86,7 +86,10 @@
   META_COMP_WINDOW_NORMAL,
   META_COMP_WINDOW_DND,
   META_COMP_WINDOW_DESKTOP,
-  META_COMP_WINDOW_DOCK
+  META_COMP_WINDOW_DOCK,
+  META_COMP_WINDOW_MENU,
+  META_COMP_WINDOW_DROP_DOWN_MENU,
+  META_COMP_WINDOW_TOOLTIP,
 } MetaCompWindowType;
 
 typedef enum _MetaShadowType
@@ -117,6 +120,8 @@
   Atom atom_net_wm_window_type_utility;
   Atom atom_net_wm_window_type_splash;
   Atom atom_net_wm_window_type_toolbar;
+  Atom atom_net_wm_window_type_dropdown_menu;
+  Atom atom_net_wm_window_type_tooltip;
 
 #ifdef USE_IDLE_REPAINT
   guint repaint_id;
@@ -895,7 +900,18 @@
     meta_verbose ("Window has shadow as it is not ARGB\n");
     return TRUE;
   }
-  
+
+  if (cw->type == META_COMP_WINDOW_MENU || 
+      cw->type == META_COMP_WINDOW_DROP_DOWN_MENU) {
+    meta_verbose ("Window has shadow as it is a menu\n");
+    return TRUE;
+  }
+
+  if (cw->type == META_COMP_WINDOW_TOOLTIP) {
+    meta_verbose ("Window has shadow as it is a tooltip\n");
+    return TRUE;
+  }
+
   meta_verbose ("Window has no shadow as it fell through\n");
   return FALSE;
 }
@@ -1721,7 +1737,9 @@
           atoms[i] == compositor->atom_net_wm_window_type_dialog ||
           atoms[i] == compositor->atom_net_wm_window_type_normal ||
           atoms[i] == compositor->atom_net_wm_window_type_utility ||
-          atoms[i] == compositor->atom_net_wm_window_type_splash)
+          atoms[i] == compositor->atom_net_wm_window_type_splash ||
+          atoms[i] == compositor->atom_net_wm_window_type_dropdown_menu ||
+          atoms[i] == compositor->atom_net_wm_window_type_tooltip)
         {
           type_atom = atoms[i];
           break;
@@ -1736,6 +1754,12 @@
     cw->type = META_COMP_WINDOW_DESKTOP;
   else if (type_atom == compositor->atom_net_wm_window_type_dock)
     cw->type = META_COMP_WINDOW_DOCK;
+  else if (type_atom == compositor->atom_net_wm_window_type_menu)
+    cw->type = META_COMP_WINDOW_MENU;
+  else if (type_atom == compositor->atom_net_wm_window_type_dropdown_menu)
+    cw->type = META_COMP_WINDOW_DROP_DOWN_MENU;
+  else if (type_atom == compositor->atom_net_wm_window_type_tooltip)
+    cw->type = META_COMP_WINDOW_TOOLTIP;
   else
     cw->type = META_COMP_WINDOW_NORMAL;
 
@@ -2932,7 +2956,9 @@
     "_NET_WM_WINDOW_TYPE_NORMAL",
     "_NET_WM_WINDOW_TYPE_UTILITY",
     "_NET_WM_WINDOW_TYPE_SPLASH",
-    "_NET_WM_WINDOW_TYPE_TOOLBAR"
+    "_NET_WM_WINDOW_TYPE_TOOLBAR",
+    "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU",
+    "_NET_WM_WINDOW_TYPE_TOOLTIP"
   };
   Atom atoms[G_N_ELEMENTS(atom_names)];
   MetaCompositorXRender *xrc;
@@ -2963,6 +2989,8 @@
   xrc->atom_net_wm_window_type_utility = atoms[10];
   xrc->atom_net_wm_window_type_splash = atoms[11];
   xrc->atom_net_wm_window_type_toolbar = atoms[12];
+  xrc->atom_net_wm_window_type_dropdown_menu = atoms[13];
+  xrc->atom_net_wm_window_type_tooltip = atoms[14];
 
 #ifdef USE_IDLE_REPAINT
   meta_verbose ("Using idle repaint\n");



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