Subject: Re: bug#14949: Snapped window acts like a fullscreen one (Windows 7)

From: martin rudalics <[email-masked]>
Date: Sun, 05 Jan 2014 11:37:46 +0100

>>> Win + left arrow
 >> What does this do - move the frame to the left display border or make it
 >> fullheight/fullwidth?
 >
 > It moves the frame to the left display border, and resizes it to
 > fullheight and half-width (so you can type Win+right into another
 > application and have the apps use the full screen side by side).

But does this mean that your Emacs also sets the fullscreen parameter to
FULLHEIGHT when it processes the request?  Can you describe how Emacs
processes this request internally?

 >>> M-: (frame-parameter nil 'fullscreen)   => nil
 >>> M-: (set-frame-parameter nil 'fullscreen nil)
 >>>
 >>> The frame is "restored" to a default size.
 >> Why is that bad?
 >
 > Because `frame-parameter' just told us that the frame wasn't
 > full-anything, so setting it again to fullscreen = nil shouldn't
 > change it, should it?

Agreed.

 > Or, alternatively, restoring the frame to its
 > previous size is useful, but then I would expect that, after Win+left,
 > (frame-parameter nil 'fullscreen) => fullheight

Agreed.

 > Which is what I said:
 >
 >>> So the frame, when snapped to the left or rigth, acts like a
 >>> (fullscreen . fullheight) one, but it is not marked as such.

I'm still too silly to understand what's going on.  Let me give you a
simple example: With emacs -Q resize your frame by dragging its borders.
Then evaluate (set-frame-parameter nil 'fullscreen nil).  Here nothing
changes.  Does anything change on your system?

So apparently Win+left does something different than "simply dragging
the frame's borders" and I yet have to understand what.  What happens
when you remove the

       else
         {
	  ShowWindow (hwnd, SW_SHOWNORMAL);
	  w32_fullscreen_rect (hwnd, f->want_fullscreen,
			       FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect);
           SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top,
                         rect.right - rect.left, rect.bottom - rect.top, 0);
         }

part in w32fullscreen_hook?

martin