GNU bug report logs - #13426
Frame parameter fullscreen and maximized

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Sun, 13 Jan 2013 10:18:02 UTC

Severity: normal

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13426 in the body.
You can then email your comments to 13426 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13426; Package emacs. (Sun, 13 Jan 2013 10:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 13 Jan 2013 10:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Frame parameter fullscreen and maximized
Date: Sun, 13 Jan 2013 12:16:23 +0200
There are two problems discovered at
http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00203.html

1. On non-GTK builds when the Gnome system key M-f10 maximizes the frame,
   Emacs doesn't reflect this change in the frame parameter `fullscreen'.

   The test case that demonstrates this problem:

   1. emacs -Q
   2. Eval (frame-parameter nil 'fullscreen) => nil
   3. Maximize the frame using Gnome system keys.
   4. Eval (frame-parameter nil 'fullscreen) => nil
   5. Maximize the frame using `M-x toggle-frame-maximized RET'
   6. Eval (frame-parameter nil 'fullscreen) => 'maximized

   Running xprop on the maximized frame outputs:
   _NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ

2. On GTK builds there is another problem: evaluating

   (set-frame-parameter nil 'fullscreen 'fullscreen)

   modifies the frame parameter `fullscreen' to `fullboth',
   not to `fullscreen' as requested.  In this case xprop outputs:
   _NET_WM_STATE(ATOM) = _NET_WM_STATE_FULLSCREEN

   Second call of (set-frame-parameter nil 'fullscreen 'fullscreen)
   modifies the frame parameter `fullscreen' from `fullboth' to `fullscreen'.

   So to go to `fullscreen' requires two calls of
   (set-frame-parameter nil 'fullscreen 'fullscreen)

   Maybe the second problem could be fixed with a patch like below where
   `toggle-frame-fullscreen' checks for `fullboth' as an alias for `fullscreen':

=== modified file 'lisp/frame.el'
--- lisp/frame.el	2013-01-03 00:36:36 +0000
+++ lisp/frame.el	2013-01-13 10:13:09 +0000
@@ -1666,7 +1666,7 @@ (defun toggle-frame-maximized ()
 after disabling fullscreen mode.
 See also `toggle-frame-fullscreen'."
   (interactive)
-  (if (eq (frame-parameter nil 'fullscreen) 'fullscreen)
+  (if (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
       (modify-frame-parameters
        nil
        `((maximized
@@ -1690,10 +1690,10 @@ (defun toggle-frame-fullscreen ()
   (modify-frame-parameters
    nil
    `((maximized
-      . ,(unless (eq (frame-parameter nil 'fullscreen) 'fullscreen)
+      . ,(unless (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
 	   (frame-parameter nil 'fullscreen)))
      (fullscreen
-      . ,(if (eq (frame-parameter nil 'fullscreen) 'fullscreen)
+      . ,(if (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
 	     (if (eq (frame-parameter nil 'maximized) 'maximized)
 		 'maximized)
 	   'fullscreen)))))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13426; Package emacs. (Sun, 04 Jan 2015 18:10:03 GMT) Full text and rfc822 format available.

Message #8 received at 13426 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> jurta.org>, 13426 <at> debbugs.gnu.org
Subject: Re: bug#13426: Frame parameter fullscreen and maximized
Date: Sun, 04 Jan 2015 19:09:27 +0100
Hi Juri

> 1. On non-GTK builds when the Gnome system key M-f10 maximizes the frame,
>     Emacs doesn't reflect this change in the frame parameter `fullscreen'.
>
>     The test case that demonstrates this problem:
>
>     1. emacs -Q
>     2. Eval (frame-parameter nil 'fullscreen) => nil
>     3. Maximize the frame using Gnome system keys.
>     4. Eval (frame-parameter nil 'fullscreen) => nil
>     5. Maximize the frame using `M-x toggle-frame-maximized RET'
>     6. Eval (frame-parameter nil 'fullscreen) => 'maximized
>
>     Running xprop on the maximized frame outputs:
>     _NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ
>
> 2. On GTK builds there is another problem: evaluating
>
>     (set-frame-parameter nil 'fullscreen 'fullscreen)
>
>     modifies the frame parameter `fullscreen' to `fullboth',
>     not to `fullscreen' as requested.  In this case xprop outputs:
>     _NET_WM_STATE(ATOM) = _NET_WM_STATE_FULLSCREEN
>
>     Second call of (set-frame-parameter nil 'fullscreen 'fullscreen)
>     modifies the frame parameter `fullscreen' from `fullboth' to `fullscreen'.
>
>     So to go to `fullscreen' requires two calls of
>     (set-frame-parameter nil 'fullscreen 'fullscreen)
>
>     Maybe the second problem could be fixed with a patch like below where
>     `toggle-frame-fullscreen' checks for `fullboth' as an alias for `fullscreen':

Are these issues still valid?  There have been lots of changes in this
area.

martin





Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Sun, 11 Jan 2015 21:03:03 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> jurta.org>:
bug acknowledged by developer. (Sun, 11 Jan 2015 21:03:04 GMT) Full text and rfc822 format available.

Message #13 received at 13426-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 13426-done <at> debbugs.gnu.org
Subject: Re: bug#13426: Frame parameter fullscreen and maximized
Date: Sun, 11 Jan 2015 22:57:18 +0200
> Are these issues still valid?  There have been lots of changes in this
> area.

Both issues are fixed.

However, now I see another related problem: having this code in ~/.emacs,

  (add-hook 'after-init-hook
            (lambda ()
              (toggle-frame-maximized))
            t)

I get a maximized frame visually, but internally with unmaximized dimensions,
i.e. mouse avoidance moves the mouse pointer to the middle of the frame instead
of the edges (because it uses frame dimensions from unmaximized frame), etc.
This is a recent bug that breaks frame dimensions after desktop frame restore.
If you already know about this problem, could you please point me to the
existing bug report, or should I create a new one?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13426; Package emacs. (Mon, 12 Jan 2015 07:38:02 GMT) Full text and rfc822 format available.

Message #16 received at 13426-done <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> jurta.org>
Cc: 13426-done <at> debbugs.gnu.org
Subject: Re: bug#13426: Frame parameter fullscreen and maximized
Date: Mon, 12 Jan 2015 08:37:01 +0100
> Both issues are fixed.

Fine.

> However, now I see another related problem: having this code in ~/.emacs,
>
>    (add-hook 'after-init-hook
>              (lambda ()
>                (toggle-frame-maximized))
>              t)
>
> I get a maximized frame visually, but internally with unmaximized dimensions,
> i.e. mouse avoidance moves the mouse pointer to the middle of the frame instead
> of the edges (because it uses frame dimensions from unmaximized frame), etc.

Works normally on Windows here.  What does `window--dump-frame' produce
on such a frame?  Do you get the same behavior when you add (fullscreen
. maximized) to `initial-frame-alist' or `default-frame-alist'?

> This is a recent bug that breaks frame dimensions after desktop frame restore.

Hmmm...  How recent?  Does desktop frame restore use `toggle-frame-maximized'?

> If you already know about this problem, could you please point me to the
> existing bug report, or should I create a new one?

Please create a new one.

martin




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 09 Feb 2015 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 137 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.