diff options
author | Hans Breuer <hans@breuer.org> | 2003-11-15 20:35:55 +0000 |
---|---|---|
committer | Hans Breuer <hans@src.gnome.org> | 2003-11-15 20:35:55 +0000 |
commit | 947b32b7dcaf233f3c2bb9a38fb07c2c64a1ee0b (patch) | |
tree | 291ecb13f1f016b39addcbe1d9f84c551f5d982e /gdk/win32/gdkwindow-win32.c | |
parent | 9e831c8b8ea506d02e31d4aefa86f49a29a395a6 (diff) | |
download | gdk-pixbuf-947b32b7dcaf233f3c2bb9a38fb07c2c64a1ee0b.tar.gz |
updated added all the new tests
2003-11-15 Hans Breuer <hans@breuer.org>
* gdk/makefile.msc gdk/gdk.def
gtk/gtk.def gtk/makefile.msc.in : updated
* tests/makefile.msc : added all the new tests
* gtk/gtkfilefilter.c(finalize) : initialize filter
from object not from itself
* gtk/gtkfilesystemwin32.[hc] : copied from gtkfilesystemunix.[hc]
modified as less as posible to have aworking implementation
on win32. There maybe the desire to merge the unchanged pats into
a common base class.
Also implemented a simple glib based bookmark handling, which
is currently missing in gtkfilesystemunix.[hc] but can be copied
over there.
* gtk/gtkfilechooserwidget.c : conditional include gtkfilesystemwin32.h
* gdk/win32/gdkwindow-win32.c : implement
gdk_window_set_keep_above() and gdk_window_set_keep_below()
* tests/testmerge.c : don't include unistd.h unconditionally,
#define STDOUT_FILENO if it isn't defined
* tests/testfilechooser.c : make it compile on win32
Diffstat (limited to 'gdk/win32/gdkwindow-win32.c')
-rw-r--r-- | gdk/win32/gdkwindow-win32.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 6651e5466..e2b7d629a 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -732,6 +732,12 @@ gdk_window_foreign_new_for_display (GdkDisplay *display, private->state &= (~GDK_WINDOW_STATE_WITHDRAWN); else private->state |= GDK_WINDOW_STATE_WITHDRAWN; + if (GetWindowLong ((HWND)anid, GWL_EXSTYLE) & WS_EX_TOPMOST) + private->state |= GDK_WINDOW_STATE_ABOVE; + else + private->state &= (~GDK_WINDOW_STATE_ABOVE); + private->state &= (~GDK_WINDOW_STATE_BELOW); + private->depth = gdk_visual_get_system ()->depth; _gdk_window_init_position (GDK_WINDOW (private)); @@ -954,6 +960,19 @@ show_window_internal (GdkWindow *window, old_active_window = GetActiveWindow (); + if (private->state & (GDK_WINDOW_STATE_BELOW | GDK_WINDOW_STATE_ABOVE)) + { + DWORD exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE); + + if (private->state & GDK_WINDOW_STATE_BELOW) + exstyle &= (~WS_EX_TOPMOST); + if (private->state & GDK_WINDOW_STATE_ABOVE) + exstyle |= WS_EX_TOPMOST; + + if (!SetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE, exstyle)) + WIN32_API_FAILED ("SetWindowLong"); + } + if (private->state & GDK_WINDOW_STATE_FULLSCREEN) gdk_window_fullscreen (window); else if (private->state & GDK_WINDOW_STATE_MAXIMIZED) @@ -2703,6 +2722,46 @@ gdk_window_unfullscreen (GdkWindow *window) } void +gdk_window_set_keep_above (GdkWindow *window, gboolean setting) +{ + g_return_if_fail (GDK_IS_WINDOW (window)); + + if (GDK_WINDOW_DESTROYED (window)) + return; + + if (GDK_WINDOW_IS_MAPPED (window)) + { + if (!SetWindowPos(GDK_WINDOW_HWND (window), setting ? HWND_TOPMOST : HWND_NOTOPMOST, + 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE)) + WIN32_API_FAILED ("SetWindowPos"); + } + else + gdk_synthesize_window_state (window, + setting ? GDK_WINDOW_STATE_BELOW : GDK_WINDOW_STATE_ABOVE, + setting ? GDK_WINDOW_STATE_ABOVE : 0); +} + +void +gdk_window_set_keep_below (GdkWindow *window, gboolean setting) +{ + g_return_if_fail (GDK_IS_WINDOW (window)); + + if (GDK_WINDOW_DESTROYED (window)) + return; + + if (GDK_WINDOW_IS_MAPPED (window)) + { + if (!SetWindowPos(GDK_WINDOW_HWND (window), setting ? HWND_BOTTOM : HWND_NOTOPMOST, + 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE)) + WIN32_API_FAILED ("SetWindowPos"); + } + else + gdk_synthesize_window_state (window, + setting ? GDK_WINDOW_STATE_ABOVE : GDK_WINDOW_STATE_BELOW, + setting ? GDK_WINDOW_STATE_BELOW : 0); +} + +void gdk_window_focus (GdkWindow *window, guint32 timestamp) { |