After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 763835 - W32: Layered windows don't become minimized
W32: Layered windows don't become minimized
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-03-17 20:13 UTC by LRN
Modified: 2016-03-18 07:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GDK W32: Don't move iconic windows (3.40 KB, patch)
2016-03-17 20:13 UTC, LRN
none Details | Review
GDK W32: Don't move iconic windows (2.99 KB, patch)
2016-03-17 20:53 UTC, LRN
none Details | Review
GDK W32: Don't move iconic windows (2.98 KB, patch)
2016-03-18 07:46 UTC, LRN
committed Details | Review

Description LRN 2016-03-17 20:13:29 UTC
Minimizing layered windows doesn't work. They lose Z order and
focus, but don't disappear from the screen.
Comment 1 LRN 2016-03-17 20:13:36 UTC
Created attachment 324213 [details] [review]
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.
Comment 2 LRN 2016-03-17 20:53:53 UTC
Created attachment 324216 [details] [review]
GDK W32: Don't move iconic windows

v2:
* Removed a stray line of junk code
Comment 3 Fan, Chun-wei 2016-03-18 04:33:49 UTC
Review of attachment 324216 [details] [review]:

Hi LRN,

I think this patch looks and works well for me, probably you want to remove the 2 extra empty lines that I marked.

Thanks!

With blessings, and cheers!

::: gdk/win32/gdkwindow-win32.c
@@ -228,1 +227,1 @@
 

We could remove this empty line.

@@ -229,6 +228,11 @@
-  API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
-                           SWP_NOZORDER_SPECIFIED,
-                           window_rect.left, window_rect.top,
... 3 more ...
+  if (IsIconic (GDK_WINDOW_HWND (window)))
+    {
+      GDK_NOTE (EVENTS, g_print ("Setting window position ... "));
... 8 more ...

Also this line...
Comment 4 LRN 2016-03-18 07:46:27 UTC
Created attachment 324233 [details] [review]
GDK W32: Don't move iconic windows

v3:
* Removed empty lines
* Inverted the condition (now matches the commit message and my intent).
Comment 5 Ignacio Casal Quinteiro (nacho) 2016-03-18 07:47:27 UTC
Review of attachment 324233 [details] [review]:

Loos ok to me.
Comment 6 LRN 2016-03-18 07:52:48 UTC
Attachment 324233 [details] pushed as 7d2a7a5 - GDK W32: Don't move iconic windows