[gtk+/gtk-2-24] win32: Make all GDK_WINDOW_TEMP always on top



commit 3df3cafdbb4886efe92a5cd62237cfc04ec6967e
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Tue Dec 6 17:06:56 2011 +0100

    win32: Make all GDK_WINDOW_TEMP always on top
    
    This makes menus, popups and tooltips show above the windows
    task bar.
    
    Backported from commit 62b505174f16743833467290f49c1ae09c25448e
    on master branch.

 gdk/win32/gdkwindow-win32.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 60a7dd6..d261f19 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -655,7 +655,7 @@ _gdk_window_impl_new (GdkWindow     *window,
       /* A temp window is not necessarily a top level window */
       dwStyle = (_gdk_root == real_parent ? WS_POPUP : WS_CHILDWINDOW);
       dwStyle |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
-      dwExStyle |= WS_EX_TOOLWINDOW;
+      dwExStyle |= WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
       offset_x = _gdk_offset_x;
       offset_y = _gdk_offset_y;
       break;
@@ -1266,10 +1266,11 @@ show_window_internal (GdkWindow *window,
     }
 
   /* Sync STATE_ABOVE to TOPMOST */
-  if (((private->state & GDK_WINDOW_STATE_ABOVE) &&
+  if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_TEMP &&
+      (((private->state & GDK_WINDOW_STATE_ABOVE) &&
        !(exstyle & WS_EX_TOPMOST)) ||
       (!(private->state & GDK_WINDOW_STATE_ABOVE) &&
-       (exstyle & WS_EX_TOPMOST)))
+       (exstyle & WS_EX_TOPMOST))))
     {
       API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
 			       (private->state & GDK_WINDOW_STATE_ABOVE)?HWND_TOPMOST:HWND_NOTOPMOST,
@@ -3137,9 +3138,10 @@ update_style_bits (GdkWindow *window)
   new_style = old_style;
   new_exstyle = old_exstyle;
 
-  if (private->window_type == GDK_WINDOW_TEMP ||
-      impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY)
-    new_exstyle |= WS_EX_TOOLWINDOW;
+  if (private->window_type == GDK_WINDOW_TEMP)
+    new_exstyle |= WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
+  else if (impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY)
+    new_exstyle |= WS_EX_TOOLWINDOW ;
   else
     new_exstyle &= ~WS_EX_TOOLWINDOW;
 



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