unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: 13426@debbugs.gnu.org
Subject: bug#13426: Frame parameter fullscreen and maximized
Date: Sun, 13 Jan 2013 12:16:23 +0200	[thread overview]
Message-ID: <87txql2xs8.fsf@mail.jurta.org> (raw)

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)))))






             reply	other threads:[~2013-01-13 10:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-13 10:16 Juri Linkov [this message]
2015-01-04 18:09 ` bug#13426: Frame parameter fullscreen and maximized martin rudalics
2015-01-11 20:57   ` Juri Linkov
2015-01-12  7:37     ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87txql2xs8.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=13426@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).