[gtk+] GDK W32: Don't move iconic windows
- From: Руслан Ижбулатов <ruslanizhb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GDK W32: Don't move iconic windows
- Date: Fri, 18 Mar 2016 07:50:45 +0000 (UTC)
commit 7d2a7a56267b8444ba1756a9a6a52157fd931758
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date: Thu Mar 17 20:07:33 2016 +0000
GDK W32: Don't move iconic windows
Using UpdateLayeredWindow() on iconic windows brings them *back* from
their iconic (minimized) state. That is bad.
As a precaution, also don't use SetWindowPos() on iconic windows.
This means that iconic windows can't be moved. That is fixable
by using SetWindowPlacement(), but there is no pressing need to do so,
as there are very few cases when windows need to be moved while minimized.
https://bugzilla.gnome.org/show_bug.cgi?id=763835
gdk/win32/gdkwindow-win32.c | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
---
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index d112d32..bedf535 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -224,16 +224,24 @@ static void
gdk_win32_window_apply_queued_move_resize (GdkWindow *window,
RECT window_rect)
{
- GDK_NOTE (EVENTS, g_print ("Setting window position ... "));
+ if (!IsIconic (GDK_WINDOW_HWND (window)))
+ {
+ GDK_NOTE (EVENTS, g_print ("Setting window position ... "));
+
+ API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
+ SWP_NOZORDER_SPECIFIED,
+ window_rect.left, window_rect.top,
+ window_rect.right - window_rect.left,
+ window_rect.bottom - window_rect.top,
+ SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOREDRAW));
- API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
- SWP_NOZORDER_SPECIFIED,
- window_rect.left, window_rect.top,
- window_rect.right - window_rect.left,
- window_rect.bottom - window_rect.top,
- SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOREDRAW));
+ GDK_NOTE (EVENTS, g_print (" ... set window position\n"));
+
+ return;
+ }
- GDK_NOTE (EVENTS, g_print (" ... set window position\n"));
+ /* Don't move iconic windows */
+ /* TODO: use SetWindowPlacement() to change non-minimized window position */
}
static gboolean
@@ -349,6 +357,14 @@ gdk_win32_window_end_paint (GdkWindow *window)
cairo_surface_flush (impl->cache_surface);
hdc = cairo_win32_surface_get_dc (impl->cache_surface);
+ /* Don't use UpdateLayeredWindow on minimized windows */
+ if (IsIconic (GDK_WINDOW_HWND (window)))
+ {
+ gdk_win32_window_apply_queued_move_resize (window, window_rect);
+
+ return;
+ }
+
/* Move, resize and redraw layered window in one call */
API_CALL (UpdateLayeredWindow, (GDK_WINDOW_HWND (window), NULL,
&window_position, &window_size,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]