* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
@ 2018-06-25 20:43 Carlos Pita
2018-06-27 10:07 ` Robert Pluim
0 siblings, 1 reply; 46+ messages in thread
From: Carlos Pita @ 2018-06-25 20:43 UTC (permalink / raw)
To: 31968
In gnome decorations are considered part of the client (even classic
titlebars) in the sense that it's the client who decides to show them or
not (see [1] and [2]). In waylan there is no other way around, but they
also decided to pretend X apps behave like that. This is very frustrating
since the reality is that many clients don't work in that way yet.
So this is a request to add a gtk-hide-titlebar-if-maximized or similar
variable since I assume emacs won't be using proper CSDs for a long
time, maybe for good. Without that variable it's not possible to achieve
the same humble goal in the strange new world of gnome, at least not without
lots of xprop, xwinifo, xdotool, wmctrl, etc. horrible hacks. As I said,
it's supposed to be the client who knows what to show and when to show
it.
---
[1] https://blogs.gnome.org/tbernard/2018/01/26/csd-initiative/
[2] https://bugzilla.gnome.org/show_bug.cgi?id=775061
In GNU Emacs 26.1.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
of 2018-06-18 built on carlos
Repository revision: 0a8b7f365cbc8de02ddb4e806dd76b1bf6302565
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Manjaro Linux
Recent messages:
Loading ido-completing-read+...done
Loading paren...done
Loading winner...done
Loading xclip...done
Loading a theme can run Lisp code. Really load? (y or n) y
Treat this theme as safe in future sessions? (y or n) y
[yas] Prepared just-in-time loading of snippets successfully.
Saving file /home/carlos/.emacs.d/init.el...
Wrote /home/carlos/.emacs.d/init.el [2 times]
For information about GNU Emacs and the GNU system, type C-h C-a.
Configured using:
'configure --prefix=/home/carlos/Local/stow/emacs-26
--libexecdir=/home/carlos/Local/stow/emacs-26/lib --with-x-toolkit=gtk3
--with-xft --with-modules'
Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS NOTIFY ACL GNUTLS
LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
MODULES THREADS LIBSYSTEMD LCMS2
Important settings:
value of $LC_MONETARY: en_US.UTF-8
value of $LC_NUMERIC: en_US.UTF-8
value of $LC_TIME: en_US.UTF-8
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
display-line-numbers-mode: t
flymake-mode: t
pyvenv-mode: t
shell-dirtrack-mode: t
diff-auto-refine-mode: t
xclip-mode: t
winner-mode: t
show-paren-mode: t
ido-ubiquitous-mode: t
ido-everywhere: t
global-company-mode: t
company-mode: t
display-battery-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
display-line-numbers checkdoc pp cl-extra yasnippet
highlight-indentation flymake-proc flymake warnings help-fns radix-tree
help-mode elpy find-file-in-project ivy delsel ivy-overlay ffap
thingatpt elpy-shell pyvenv esh-var esh-io esh-cmd esh-opt esh-ext
esh-proc esh-arg esh-groups eshell esh-module esh-mode esh-util
elpy-profile elpy-django elpy-refactor subr-x python tramp-sh tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
parse-time format-spec advice json map grep compile comint ansi-color
files-x doom-themes-org windmove vc-git diff-mode easy-mmode
company-oddmuse company-keywords company-etags etags xref project
company-gtags company-dabbrev-code company-dabbrev company-files
company-capf company-cmake company-xcode company-clang company-semantic
company-eclim company-template company-css company-nxml company-bbdb
doom-tomorrow-night-theme doom-themes doom-themes-common elec-pair xclip
winner ring paren ido-completing-read+ memoize s cus-edit minibuf-eldef
ido gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045
ietf-drums mail-utils mm-util mail-prsvr wid-edit company edmacro kmacro
pcase battery cus-start cus-load finder-inf info package easymenu
epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib server time-date mule-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)
Memory information:
((conses 16 446497 14130)
(symbols 48 36746 2)
(miscs 40 74 141)
(strings 32 98962 3555)
(string-bytes 1 2638751)
(vectors 16 55867)
(vector-slots 8 983572 13084)
(floats 8 276 155)
(intervals 56 304 0)
(buffers 992 14))
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-25 20:43 bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd) Carlos Pita
@ 2018-06-27 10:07 ` Robert Pluim
2018-06-27 13:02 ` Carlos Pita
0 siblings, 1 reply; 46+ messages in thread
From: Robert Pluim @ 2018-06-27 10:07 UTC (permalink / raw)
To: Carlos Pita; +Cc: 31968
Carlos Pita <carlosjosepita@gmail.com> writes:
> In gnome decorations are considered part of the client (even classic
> titlebars) in the sense that it's the client who decides to show them or
> not (see [1] and [2]). In waylan there is no other way around, but they
> also decided to pretend X apps behave like that. This is very frustrating
> since the reality is that many clients don't work in that way yet.
>
> So this is a request to add a gtk-hide-titlebar-if-maximized or similar
> variable since I assume emacs won't be using proper CSDs for a long
> time, maybe for good. Without that variable it's not possible to achieve
> the same humble goal in the strange new world of gnome, at least not without
> lots of xprop, xwinifo, xdotool, wmctrl, etc. horrible hacks. As I said,
> it's supposed to be the client who knows what to show and when to show
> it.
Could you explain in a bit more detail what GTK call(s) would need to
change in order to implement such a variable? That would allow us to
evaluate the effort (although personally Iʼd rather spend effort
towards implementing GTK as a native frame type).
Regards
Robert
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-27 10:07 ` Robert Pluim
@ 2018-06-27 13:02 ` Carlos Pita
2018-06-27 13:25 ` Robert Pluim
2018-06-28 8:02 ` martin rudalics
0 siblings, 2 replies; 46+ messages in thread
From: Carlos Pita @ 2018-06-27 13:02 UTC (permalink / raw)
To: Robert Pluim; +Cc: 31968
[-- Attachment #1: Type: text/plain, Size: 351 bytes --]
One simple possibility is to set/unset
the _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED property. I think there is also a
corresponding gtk api for that but maybe the property could be set using
standard X machinery already exposed to elisp(?). Probably all this would
be ineffective under waylan but it's simply enough to fix the problem for X
with low effort.
[-- Attachment #2: Type: text/html, Size: 379 bytes --]
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-27 13:02 ` Carlos Pita
@ 2018-06-27 13:25 ` Robert Pluim
2018-06-27 15:20 ` Carlos Pita
2018-06-28 8:02 ` martin rudalics
1 sibling, 1 reply; 46+ messages in thread
From: Robert Pluim @ 2018-06-27 13:25 UTC (permalink / raw)
To: Carlos Pita; +Cc: 31968
Carlos Pita <carlosjosepita@gmail.com> writes:
> One simple possibility is to set/unset
> the _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED property. I think there is also a
> corresponding gtk api for that but maybe the property could be set using
> standard X machinery already exposed to elisp(?). Probably all this would
> be ineffective under waylan but it's simply enough to fix the problem for X
> with low effort.
This is not quite what you asked for, but have you tried:
(modify-frame-parameters nil '((undecorated t)))
Robert
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-27 13:25 ` Robert Pluim
@ 2018-06-27 15:20 ` Carlos Pita
2018-06-28 4:22 ` Jonathan Kyle Mitchell
0 siblings, 1 reply; 46+ messages in thread
From: Carlos Pita @ 2018-06-27 15:20 UTC (permalink / raw)
To: Robert Pluim; +Cc: 31968
Yes, but the point is to hook something like that on
maximized/unmaximized events, which I don't see how to do.
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-27 15:20 ` Carlos Pita
@ 2018-06-28 4:22 ` Jonathan Kyle Mitchell
2018-06-28 8:02 ` martin rudalics
0 siblings, 1 reply; 46+ messages in thread
From: Jonathan Kyle Mitchell @ 2018-06-28 4:22 UTC (permalink / raw)
To: carlosjosepita; +Cc: 31968, rpluim
On Wed, Jun 27, 2018 at 10:21 AM Carlos Pita <carlosjosepita@gmail.com> wrote:
>
> Yes, but the point is to hook something like that on
> maximized/unmaximized events, which I don't see how to do.
Since maximizing a frame changes the window size, couldn't you hook
into window-size-change-functions to achieve the desired effect?
Something like this perhaps:
(defun hide-titlebar-when-maximized (frame)
(if (eq 'maximized (alist-get 'fullscreen (frame-parameters frame)))
(set-frame-parameter frame 'undecorated t)
(set-frame-parameter frame 'undecorated nil)))
(add-hook 'window-size-change-functions 'hide-titlebar-when-maximized)
--
Jonathan Kyle Mitchell
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-28 4:22 ` Jonathan Kyle Mitchell
@ 2018-06-28 8:02 ` martin rudalics
2018-06-28 12:23 ` Robert Pluim
0 siblings, 1 reply; 46+ messages in thread
From: martin rudalics @ 2018-06-28 8:02 UTC (permalink / raw)
To: Jonathan Kyle Mitchell, carlosjosepita; +Cc: 31968, rpluim
>> Yes, but the point is to hook something like that on
>> maximized/unmaximized events, which I don't see how to do.
>
> Since maximizing a frame changes the window size, couldn't you hook
> into window-size-change-functions to achieve the desired effect?
> Something like this perhaps:
>
> (defun hide-titlebar-when-maximized (frame)
> (if (eq 'maximized (alist-get 'fullscreen (frame-parameters frame)))
> (set-frame-parameter frame 'undecorated t)
> (set-frame-parameter frame 'undecorated nil)))
>
> (add-hook 'window-size-change-functions 'hide-titlebar-when-maximized)
Wouldn't that show the title bar when making the frame fullscreen via
F11?
martin
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-27 13:02 ` Carlos Pita
2018-06-27 13:25 ` Robert Pluim
@ 2018-06-28 8:02 ` martin rudalics
2018-06-28 15:25 ` Robert Pluim
1 sibling, 1 reply; 46+ messages in thread
From: martin rudalics @ 2018-06-28 8:02 UTC (permalink / raw)
To: Carlos Pita, Robert Pluim; +Cc: 31968
> One simple possibility is to set/unset
> the _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED property. I think there is also a
> corresponding gtk api for that but maybe the property could be set using
> standard X machinery already exposed to elisp(?). Probably all this would
> be ineffective under waylan but it's simply enough to fix the problem for X
> with low effort.
Could someone try to add a 'xg_set_hide_titlebar_when_maximized'
function to gtkutil.c. That would be just like 'xg_set_undecorated'
but call 'gtk_window_set_hide_titlebar_when_maximized' instead of
'gtk_window_set_decorated'. The Lisp interface for the moment could
be a simple 'x-set-hide-titlebar-when-maximized' function with a FRAME
and HIDE argument defined in xfns.c for GTK only that calls
'xg_set_hide_titlebar_when_maximized' with a frame structure
corresponding to the frame argument.
'gdk_x11_window_set_hide_title_bar_when_maximized' in gdkwindow-x11.c
has the XChangeProperty calls to make this work for non-GTK builds.
martin
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-28 8:02 ` martin rudalics
@ 2018-06-28 12:23 ` Robert Pluim
0 siblings, 0 replies; 46+ messages in thread
From: Robert Pluim @ 2018-06-28 12:23 UTC (permalink / raw)
To: martin rudalics; +Cc: 31968, carlosjosepita, Jonathan Kyle Mitchell
martin rudalics <rudalics@gmx.at> writes:
>>> Yes, but the point is to hook something like that on
>>> maximized/unmaximized events, which I don't see how to do.
>>
>> Since maximizing a frame changes the window size, couldn't you hook
>> into window-size-change-functions to achieve the desired effect?
>> Something like this perhaps:
>>
>> (defun hide-titlebar-when-maximized (frame)
>> (if (eq 'maximized (alist-get 'fullscreen (frame-parameters frame)))
>> (set-frame-parameter frame 'undecorated t)
>> (set-frame-parameter frame 'undecorated nil)))
>>
>> (add-hook 'window-size-change-functions 'hide-titlebar-when-maximized)
>
> Wouldn't that show the title bar when making the frame fullscreen via
> F11?
It doesnʼt for me. Note you can use 'move-frame-functions' instead of
window-size-change-functions if you prefer.
Robert
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-28 8:02 ` martin rudalics
@ 2018-06-28 15:25 ` Robert Pluim
2018-06-29 8:42 ` martin rudalics
2020-09-04 4:15 ` Lars Ingebrigtsen
0 siblings, 2 replies; 46+ messages in thread
From: Robert Pluim @ 2018-06-28 15:25 UTC (permalink / raw)
To: martin rudalics; +Cc: 31968, Carlos Pita
martin rudalics <rudalics@gmx.at> writes:
>> One simple possibility is to set/unset
>> the _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED property. I think there is also a
>> corresponding gtk api for that but maybe the property could be set using
>> standard X machinery already exposed to elisp(?). Probably all this would
>> be ineffective under waylan but it's simply enough to fix the problem for X
>> with low effort.
>
> Could someone try to add a 'xg_set_hide_titlebar_when_maximized'
> function to gtkutil.c. That would be just like 'xg_set_undecorated'
> but call 'gtk_window_set_hide_titlebar_when_maximized' instead of
> 'gtk_window_set_decorated'. The Lisp interface for the moment could
> be a simple 'x-set-hide-titlebar-when-maximized' function with a FRAME
> and HIDE argument defined in xfns.c for GTK only that calls
> 'xg_set_hide_titlebar_when_maximized' with a frame structure
> corresponding to the frame argument.
>
Patch attached. It sets the correct property on my emacs frame for me,
but it appears KWin ignores that, so I see no effect. No doubt needs a
few more USE_GTK ifdef checks.
> 'gdk_x11_window_set_hide_title_bar_when_maximized' in gdkwindow-x11.c
> has the XChangeProperty calls to make this work for non-GTK builds.
Youʼre suggesting we copy their code? Iʼm not sure what the value of
setting a GTK property is in a non-GTK build.
Robert
diff --git i/src/gtkutil.c w/src/gtkutil.c
index 69325ff00a..6cd502f430 100644
--- i/src/gtkutil.c
+++ w/src/gtkutil.c
@@ -1538,6 +1538,21 @@ xg_set_undecorated (struct frame *f, Lisp_Object undecorated)
}
}
+/* Set a property on the frame that requests the window manager to
+ hide the titlebar when it is maximized. Does not seem to work with
+ KWin. */
+void
+xg_set_hide_titlebar_when_maximized (struct frame *f, Lisp_Object hide)
+{
+ if (FRAME_GTK_WIDGET (f))
+ {
+ block_input ();
+ gtk_window_set_hide_titlebar_when_maximized
+ (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
+ NILP (hide) ? FALSE : TRUE);
+ unblock_input ();
+ }
+}
/* Restack F1 below F2, above if ABOVE_FLAG is true. This might not
work with all window managers. */
diff --git i/src/gtkutil.h w/src/gtkutil.h
index 7dcd549f5c..942238cff5 100644
--- i/src/gtkutil.h
+++ w/src/gtkutil.h
@@ -173,6 +173,7 @@ extern void xg_set_frame_icon (struct frame *f,
Pixmap icon_mask);
extern void xg_set_undecorated (struct frame *f, Lisp_Object undecorated);
+extern void xg_set_hide_titlebar_when_maximized (struct frame *f, Lisp_Object hide);
extern void xg_frame_restack (struct frame *f1, struct frame *f2, bool above);
extern void xg_set_skip_taskbar (struct frame *f, Lisp_Object skip_taskbar);
extern void xg_set_no_focus_on_map (struct frame *f, Lisp_Object no_focus_on_map);
diff --git i/src/xfns.c w/src/xfns.c
index fe8170cf63..fccf8f471a 100644
--- i/src/xfns.c
+++ w/src/xfns.c
@@ -7600,6 +7600,28 @@ visible. */)
#endif /* USE_GTK */
#endif /* USE_CAIRO */
+DEFUN ("x-set-hide-titlebar-when-maximized", Fx_set_hide_titlebar_when_maximized,
+ Sx_set_hide_titlebar_when_maximized,
+ 2, 2, 0,
+ doc:
+ /* Set titlebar hiding behavior when FRAME becomes maximized.
+If FRAME is nil it defaults to the currently selected frame. If HIDE
+is non-nil, FRAME's window-system window is requested to be drawn
+without a titlebar when it becomes maximized. If HIDE is nil,
+drawing with a titlebar is requested.
+
+Only works in build using GTK
+Some window managers may not honor this parameter.*/)
+ (Lisp_Object frame, Lisp_Object hide)
+{
+#ifdef USE_GTK
+ struct frame *f = decode_window_system_frame (frame);
+
+ xg_set_hide_titlebar_when_maximized (f, hide);
+#endif
+ return Qnil;
+}
+
\f
/***********************************************************************
Initialization
@@ -7958,4 +7980,5 @@ When using Gtk+ tooltips, the tooltip face is not used. */);
defsubr (&Sx_print_frames_dialog);
#endif
#endif
+ defsubr(&Sx_set_hide_titlebar_when_maximized);
}
^ permalink raw reply related [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-28 15:25 ` Robert Pluim
@ 2018-06-29 8:42 ` martin rudalics
2018-06-29 8:48 ` Robert Pluim
2020-09-04 4:15 ` Lars Ingebrigtsen
1 sibling, 1 reply; 46+ messages in thread
From: martin rudalics @ 2018-06-29 8:42 UTC (permalink / raw)
To: Robert Pluim; +Cc: 31968, Carlos Pita
> Patch attached. It sets the correct property on my emacs frame for me,
> but it appears KWin ignores that, so I see no effect. No doubt needs a
> few more USE_GTK ifdef checks.
Carlos, can you test the patch? If it works, we can brush it up a
little to make it a frame parameter just like 'undecorated'.
>> 'gdk_x11_window_set_hide_title_bar_when_maximized' in gdkwindow-x11.c
>> has the XChangeProperty calls to make this work for non-GTK builds.
>
> Youʼre suggesting we copy their code? Iʼm not sure what the value of
> setting a GTK property is in a non-GTK build.
FWIW I did that for x_set_undecorated when implementing that awful
PROP_MOTIF_WM_HINTS_ELEMENTS hack.
martin
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-29 8:42 ` martin rudalics
@ 2018-06-29 8:48 ` Robert Pluim
2018-06-30 8:33 ` martin rudalics
0 siblings, 1 reply; 46+ messages in thread
From: Robert Pluim @ 2018-06-29 8:48 UTC (permalink / raw)
To: martin rudalics; +Cc: 31968, Carlos Pita
martin rudalics <rudalics@gmx.at> writes:
>> Patch attached. It sets the correct property on my emacs frame for me,
>> but it appears KWin ignores that, so I see no effect. No doubt needs a
>> few more USE_GTK ifdef checks.
>
> Carlos, can you test the patch? If it works, we can brush it up a
> little to make it a frame parameter just like 'undecorated'.
That would be a somewhat bigger patch. Iʼm assuming weʼd need to
adjust nsgui and w32gui frame parameter definitions as well.
>>> 'gdk_x11_window_set_hide_title_bar_when_maximized' in gdkwindow-x11.c
>>> has the XChangeProperty calls to make this work for non-GTK builds.
>>
>> Youʼre suggesting we copy their code? Iʼm not sure what the value of
>> setting a GTK property is in a non-GTK build.
>
> FWIW I did that for x_set_undecorated when implementing that awful
> PROP_MOTIF_WM_HINTS_ELEMENTS hack.
I donʼt know what that is, and I donʼt think I want to know.
Robert
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-29 8:48 ` Robert Pluim
@ 2018-06-30 8:33 ` martin rudalics
2018-06-30 22:32 ` Jonathan Kyle Mitchell
0 siblings, 1 reply; 46+ messages in thread
From: martin rudalics @ 2018-06-30 8:33 UTC (permalink / raw)
To: Robert Pluim; +Cc: 31968, Carlos Pita
> That would be a somewhat bigger patch. Iʼm assuming weʼd need to
> adjust nsgui and w32gui frame parameter definitions as well.
For non-GTK builds we'd have to proceed as follows:
(1) When we do the maximization ourselves, remove the decorations
first and then maximize.
(2) When we get a maximize event, remove the decorations.
(3) For any event or action that removes the maximized state, re-add
the decorations provided the frame should not stay undecorated via
a frame parameter.
So this would require some quite substantial coding effort and should
definitely wait until someone confirms that your GTK patch works.
martin
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-30 8:33 ` martin rudalics
@ 2018-06-30 22:32 ` Jonathan Kyle Mitchell
2018-06-30 22:54 ` Carlos Pita
2018-07-01 9:02 ` martin rudalics
0 siblings, 2 replies; 46+ messages in thread
From: Jonathan Kyle Mitchell @ 2018-06-30 22:32 UTC (permalink / raw)
To: rudalics; +Cc: 31968, Robert Pluim, Carlos Pita
On Sat, Jun 30, 2018 at 3:38 AM martin rudalics <rudalics@gmx.at> wrote:
>
> > That would be a somewhat bigger patch. Iʼm assuming weʼd need to
> > adjust nsgui and w32gui frame parameter definitions as well.
>
> For non-GTK builds we'd have to proceed as follows:
>
> (1) When we do the maximization ourselves, remove the decorations
> first and then maximize.
>
> (2) When we get a maximize event, remove the decorations.
>
> (3) For any event or action that removes the maximized state, re-add
> the decorations provided the frame should not stay undecorated via
> a frame parameter.
>
> So this would require some quite substantial coding effort and should
> definitely wait until someone confirms that your GTK patch works.
>
> martin
I had the opportunity to test Robert's C patch on a recent copy of the
master branch today in a Fedora 28 VM using Gnome3, Xfce4, and KDE5.
Setting the hide argument to `t' in the new Lisp function
`x-set-hide-titlebar-when-maximized' worked as expected in Gnome and
Xfce--the titlebar disappeared when I maximized the Emacs frame. The
KDE titlebar remained in place except when putting Emacs in fullscreen
mode.
--
Jonathan Kyle Mitchell
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-30 22:32 ` Jonathan Kyle Mitchell
@ 2018-06-30 22:54 ` Carlos Pita
2018-06-30 23:25 ` Carlos Pita
` (2 more replies)
2018-07-01 9:02 ` martin rudalics
1 sibling, 3 replies; 46+ messages in thread
From: Carlos Pita @ 2018-06-30 22:54 UTC (permalink / raw)
To: Jonathan Kyle Mitchell; +Cc: 31968, Robert Pluim
Works for me too. I had to manually apply the patch because it doesn't
cleanly applies on latest emacs-26, but besides that it does what is
announced.
I think it's ok for this functionality to be gtk only since the kde
people (and mostly everyone else) hate the csd stuff and want their wm
to deal with decorations, old school. There is a flame war around this
issue indeed. Plasma can be configured for "hide titlebar on maximize"
but gnome and its derivatives (thinking of cinnamon here) can't. I
wonder for how long it would be even possible to hide the titlebar at
the gtk level.
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-30 22:54 ` Carlos Pita
@ 2018-06-30 23:25 ` Carlos Pita
2018-07-01 0:13 ` Carlos Pita
2018-07-02 13:21 ` Robert Pluim
2018-07-01 9:02 ` martin rudalics
2018-07-02 13:31 ` Robert Pluim
2 siblings, 2 replies; 46+ messages in thread
From: Carlos Pita @ 2018-06-30 23:25 UTC (permalink / raw)
To: Jonathan Kyle Mitchell; +Cc: 31968, Robert Pluim
Sorry if this is a silly question but what would be the right hook to
call this function? The frame should already exist but not yet be
mapped or made visible.
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-30 23:25 ` Carlos Pita
@ 2018-07-01 0:13 ` Carlos Pita
2018-07-01 9:04 ` martin rudalics
2018-07-02 13:21 ` Robert Pluim
1 sibling, 1 reply; 46+ messages in thread
From: Carlos Pita @ 2018-07-01 0:13 UTC (permalink / raw)
To: Jonathan Kyle Mitchell; +Cc: 31968, Robert Pluim
Bad news: this doesn't work under Cinnamon, only Gnome. I somehow
assumed it was gtk itself hidding the decoration, but it seems it's
not working like that.
Nevertheless I'm more fond of a pure elisp approach like the one
suggested by Johnathan (hooking from window-size-change-functions). Is
there anything wrong with that?
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-30 22:32 ` Jonathan Kyle Mitchell
2018-06-30 22:54 ` Carlos Pita
@ 2018-07-01 9:02 ` martin rudalics
2018-07-02 5:06 ` Jonathan Kyle Mitchell
1 sibling, 1 reply; 46+ messages in thread
From: martin rudalics @ 2018-07-01 9:02 UTC (permalink / raw)
To: Jonathan Kyle Mitchell; +Cc: 31968, Robert Pluim, Carlos Pita
> I had the opportunity to test Robert's C patch on a recent copy of the
> master branch today in a Fedora 28 VM using Gnome3, Xfce4, and KDE5.
> Setting the hide argument to `t' in the new Lisp function
> `x-set-hide-titlebar-when-maximized' worked as expected in Gnome and
> Xfce--the titlebar disappeared when I maximized the Emacs frame.
Thank you very much for testing. Can you check whether it works when
maximizing an undecorated frame? That is, make a new frame, in it do
(set-frame-parameter nil 'undecorated t)
then maximize it and demaximize it. Is it still undecorated?
> The
> KDE titlebar remained in place except when putting Emacs in fullscreen
> mode.
Somehow KDE is a notorious refusnik as far as Emacs frames are
concerned. While you're there: Can you confirm the strange resizing
behaviors of Bug#31968? For example, does evaluating
(modify-frame-parameters nil '((left . 0) (top . 0) (width . 130) (height . 56)))
result in a 130x56 frame?
Thanks again, martin
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-30 22:54 ` Carlos Pita
2018-06-30 23:25 ` Carlos Pita
@ 2018-07-01 9:02 ` martin rudalics
2018-07-02 13:31 ` Robert Pluim
2 siblings, 0 replies; 46+ messages in thread
From: martin rudalics @ 2018-07-01 9:02 UTC (permalink / raw)
To: Carlos Pita, Jonathan Kyle Mitchell; +Cc: 31968, Robert Pluim
> Works for me too. I had to manually apply the patch because it doesn't
> cleanly applies on latest emacs-26, but besides that it does what is
> announced.
Thank you. Which are your desktop and window manager?
> I think it's ok for this functionality to be gtk only since the kde
> people (and mostly everyone else) hate the csd stuff and want their wm
> to deal with decorations, old school. There is a flame war around this
> issue indeed. Plasma can be configured for "hide titlebar on maximize"
Does this apply to all windows even when their application has not
requested such behavior?
> but gnome and its derivatives (thinking of cinnamon here) can't. I
> wonder for how long it would be even possible to hide the titlebar at
> the gtk level.
IIUC it has been added in 3.4 so it will probably stay there for a
while.
martin
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-01 0:13 ` Carlos Pita
@ 2018-07-01 9:04 ` martin rudalics
2018-07-01 17:23 ` Carlos Pita
0 siblings, 1 reply; 46+ messages in thread
From: martin rudalics @ 2018-07-01 9:04 UTC (permalink / raw)
To: Carlos Pita, Jonathan Kyle Mitchell; +Cc: 31968, Robert Pluim
> Bad news: this doesn't work under Cinnamon, only Gnome. I somehow
> assumed it was gtk itself hidding the decoration, but it seems it's
> not working like that.
GTK just manages the settings we request and passes them on to the
window manager.
> Nevertheless I'm more fond of a pure elisp approach like the one
> suggested by Johnathan (hooking from window-size-change-functions). Is
> there anything wrong with that?
Couldn't you try it? Just check the 'fullscreen' and 'undecorated'
frame parameters there and if they don't match (that is maximized and
decorated or not-maximized and undecorated) set the 'undecorated'
parameter appropriately. Later on we have to make sure that a per se
undecorated frame does not get decorations when it's demaximized.
I'm afraid you will see some flickering though.
martin
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-01 9:04 ` martin rudalics
@ 2018-07-01 17:23 ` Carlos Pita
2018-07-01 17:35 ` Carlos Pita
2018-07-02 9:13 ` martin rudalics
0 siblings, 2 replies; 46+ messages in thread
From: Carlos Pita @ 2018-07-01 17:23 UTC (permalink / raw)
To: martin rudalics; +Cc: 31968, Robert Pluim, Jonathan Kyle Mitchell
Under Cinnamon it worked without flickering. There is just a minor
problem that could be pointing to a bug elsewhere in emacs. Cinnamon
implements a progression of tiles layouts, for instance starting from
a normal sized window (i) you press Super-Up and the window is tiled
to the top half of the screen, (ii) you then press Super-Up again and
the window is maximized, (iii) finally you press Super-Down and the
window returns to top half tile mode. In general only fully maximized
windows (ii) gets undecorated, as intended, but when transitioning
from fully maximized to top half tiled (ii->iii) emacs still sees the
maximized state in the fullscreen frame parameter and fails to
undecorate the window. Nevertheless the client state in (ii) is:
~:: xprop | grep _NET_WM_STATE
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_TILED
The problem seems to be in the reported frame parameters, not in
Jonathan's hook.
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-01 17:23 ` Carlos Pita
@ 2018-07-01 17:35 ` Carlos Pita
2018-07-01 17:46 ` Carlos Pita
2018-07-02 9:13 ` martin rudalics
1 sibling, 1 reply; 46+ messages in thread
From: Carlos Pita @ 2018-07-01 17:35 UTC (permalink / raw)
To: martin rudalics; +Cc: 31968, Robert Pluim, Jonathan Kyle Mitchell
It could be a matter of timing since sometimes (ii->iii) indeed
restores the decorations, but most of the time it doesn't.
Also I realized that the above is more simple and reliable to
reproduce by just pressing Alt-F10 twice (toggle maximized on/off),
when restoring the normal window size it doesn't get its decorations
again. I would say that this also is a timing issue, because xprop
correctly shows that the x11 window is not maximized but emacs thinks
otherwise, probably because an emacs window was resized before the x11
window properties were set by the wm.
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-01 17:35 ` Carlos Pita
@ 2018-07-01 17:46 ` Carlos Pita
2018-07-01 18:08 ` Carlos Pita
0 siblings, 1 reply; 46+ messages in thread
From: Carlos Pita @ 2018-07-01 17:46 UTC (permalink / raw)
To: martin rudalics; +Cc: 31968, Robert Pluim, Jonathan Kyle Mitchell
Same under Gnome, both Super-Up/Down tiling and Alt-10 maximize
toggling: decorations aren't restored, at least until some further
action inside the frame triggers the hook again. A more reliable hook
should be used if available.
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-01 17:46 ` Carlos Pita
@ 2018-07-01 18:08 ` Carlos Pita
2018-07-02 13:24 ` Robert Pluim
0 siblings, 1 reply; 46+ messages in thread
From: Carlos Pita @ 2018-07-01 18:08 UTC (permalink / raw)
To: martin rudalics; +Cc: 31968, Robert Pluim, Jonathan Kyle Mitchell
Moving to a more manual approach I find a new problem: at least under
gnome undecorating the frame makes it lose its focus.
(global-set-key (kbd "C-x t")
(lambda () (interactive)
(set-frame-parameter nil 'undecorated
(not (frame-parameter nil 'undecorated)))))
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-01 9:02 ` martin rudalics
@ 2018-07-02 5:06 ` Jonathan Kyle Mitchell
0 siblings, 0 replies; 46+ messages in thread
From: Jonathan Kyle Mitchell @ 2018-07-02 5:06 UTC (permalink / raw)
To: martin rudalics; +Cc: 31968, Robert Pluim, Carlos Pita
martin rudalics <rudalics@gmx.at> writes:
>> I had the opportunity to test Robert's C patch on a recent copy of the
>> master branch today in a Fedora 28 VM using Gnome3, Xfce4, and KDE5.
>> Setting the hide argument to `t' in the new Lisp function
>> `x-set-hide-titlebar-when-maximized' worked as expected in Gnome and
>> Xfce--the titlebar disappeared when I maximized the Emacs frame.
>
> Thank you very much for testing. Can you check whether it works when
> maximizing an undecorated frame? That is, make a new frame, in it do
>
> (set-frame-parameter nil 'undecorated t)
>
> then maximize it and demaximize it. Is it still undecorated?
Yes, the frame remains undecorated after both maximizing and
demaximizing it.
>> The
>> KDE titlebar remained in place except when putting Emacs in fullscreen
>> mode.
>
> Somehow KDE is a notorious refusnik as far as Emacs frames are
> concerned. While you're there: Can you confirm the strange resizing
> behaviors of Bug#31968? For example, does evaluating
>
> (modify-frame-parameters nil '((left . 0) (top . 0) (width . 130)
> (height . 56)))
>
> result in a 130x56 frame?
Yes, I get a frame-width of 130 and frame-height of 56 after running
that function.
--
Jonathan Kyle Mitchell
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-01 17:23 ` Carlos Pita
2018-07-01 17:35 ` Carlos Pita
@ 2018-07-02 9:13 ` martin rudalics
1 sibling, 0 replies; 46+ messages in thread
From: martin rudalics @ 2018-07-02 9:13 UTC (permalink / raw)
To: Carlos Pita; +Cc: 31968, Robert Pluim, Jonathan Kyle Mitchell
> Under Cinnamon it worked without flickering.
Thanks. But please post your code here so we know what we are
discussing.
> There is just a minor
> problem that could be pointing to a bug elsewhere in emacs. Cinnamon
> implements a progression of tiles layouts, for instance starting from
> a normal sized window (i) you press Super-Up and the window is tiled
> to the top half of the screen, (ii) you then press Super-Up again and
> the window is maximized, (iii) finally you press Super-Down and the
> window returns to top half tile mode. In general only fully maximized
> windows (ii) gets undecorated, as intended, but when transitioning
> from fully maximized to top half tiled (ii->iii) emacs still sees the
> maximized state in the fullscreen frame parameter and fails to
> undecorate the window. Nevertheless the client state in (ii) is:
>
> ~:: xprop | grep _NET_WM_STATE
> _NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_TILED
>
> The problem seems to be in the reported frame parameters, not in
> Jonathan's hook.
get_current_wm_state in xterm.c has this
else if (a == dpyinfo->Xatom_net_wm_state_maximized_vert)
{
if (*size_state == FULLSCREEN_WIDTH)
*size_state = FULLSCREEN_MAXIMIZED;
else
*size_state = FULLSCREEN_HEIGHT;
}
Could you try setting a GDB breakpoint at the
if (*size_state == FULLSCREEN_WIDTH)
line and see if it ever gets executed during (ii->iii).
Thanks for trying, martin
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-30 23:25 ` Carlos Pita
2018-07-01 0:13 ` Carlos Pita
@ 2018-07-02 13:21 ` Robert Pluim
1 sibling, 0 replies; 46+ messages in thread
From: Robert Pluim @ 2018-07-02 13:21 UTC (permalink / raw)
To: Carlos Pita; +Cc: 31968, Jonathan Kyle Mitchell
Carlos Pita <carlosjosepita@gmail.com> writes:
> Sorry if this is a silly question but what would be the right hook to
> call this function? The frame should already exist but not yet be
> mapped or made visible.
I think the best solution in that case would be to have a frame
parameter for this property that you could set in default-frame-alist,
that would get it applied automatically. There should then be no need
to put it in a hook.
Robert
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-01 18:08 ` Carlos Pita
@ 2018-07-02 13:24 ` Robert Pluim
2018-07-02 14:28 ` Carlos Pita
0 siblings, 1 reply; 46+ messages in thread
From: Robert Pluim @ 2018-07-02 13:24 UTC (permalink / raw)
To: Carlos Pita; +Cc: 31968, Jonathan Kyle Mitchell
Carlos Pita <carlosjosepita@gmail.com> writes:
> Moving to a more manual approach I find a new problem: at least under
> gnome undecorating the frame makes it lose its focus.
>
> (global-set-key (kbd "C-x t")
> (lambda () (interactive)
> (set-frame-parameter nil 'undecorated
> (not (frame-parameter nil 'undecorated)))))
FWIW I donʼt see this under kwin (I do have focus-follows-mouse, which
might be influencing it).
Robert
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-30 22:54 ` Carlos Pita
2018-06-30 23:25 ` Carlos Pita
2018-07-01 9:02 ` martin rudalics
@ 2018-07-02 13:31 ` Robert Pluim
2018-07-02 14:22 ` Carlos Pita
2 siblings, 1 reply; 46+ messages in thread
From: Robert Pluim @ 2018-07-02 13:31 UTC (permalink / raw)
To: Carlos Pita; +Cc: 31968, Jonathan Kyle Mitchell
Carlos Pita <carlosjosepita@gmail.com> writes:
> Works for me too. I had to manually apply the patch because it doesn't
> cleanly applies on latest emacs-26, but besides that it does what is
> announced.
It was against master. Thereʼs no way Iʼd propose a change like this
for emacs-26, itʼs something that would require a lot of testing on a
lot of different systems first (and emacs' existing maximize behaviour
already has its share of problems).
> I think it's ok for this functionality to be gtk only since the kde
> people (and mostly everyone else) hate the csd stuff and want their wm
> to deal with decorations, old school. There is a flame war around this
> issue indeed. Plasma can be configured for "hide titlebar on maximize"
> but gnome and its derivatives (thinking of cinnamon here) can't. I
> wonder for how long it would be even possible to hide the titlebar at
> the gtk level.
Yes, Plasma has an option you can set in kwinrc. Iʼm undecided whether
I like the functionality or not, but it would be better if we tried to
at least support both kde and gnome here (which probably means
figuring out if thereʼs a way to specify this per-application in kde).
Regards
Robert
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-02 13:31 ` Robert Pluim
@ 2018-07-02 14:22 ` Carlos Pita
0 siblings, 0 replies; 46+ messages in thread
From: Carlos Pita @ 2018-07-02 14:22 UTC (permalink / raw)
To: Robert Pluim; +Cc: 31968, Jonathan Kyle Mitchell
[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]
I would oppose to any change that exlicitly undecorates and redecorates the
window because (I'm summing up below what I already mentioned in a more
haphazardly way above):
1. Both under Gnome and under Cinnamon there are scenarios in which
changing the client decorated state wreaks havoc with WM operation. In
Gnome when you remove decorations the client lose focus. In Cinnamon
undecorating and redecorating a maximized window makes it completely
inaccessible, as if the WM couldn't show it anymore. I managed to make the
maximize-undecorate / unmaximize-decorate combo work under Cinnamon, but
that's all. Expect problems under other DEs and WMs.
2. Using Jonathan hook shares the problems described in point 1, since it
explicitly deals with decorations instead of just hinting the WM, but also
fails to redecorate the window in many circumstances, since the hook seems
to be called before the maximized property was removed from the frame
properties alist. Even if there were a more convenient event to hook from
(I was unable to find one in frame.el) I would disregard the solution
because of 1.
So that let's us able to support WMs that offers
_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED or a similar mechanism, or that
explicitly advertise they allow decoration change events triggered by the
client.
I've requested support for _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED in the
Cinnamon tracker [1], maybe you can argue a bit more for the feature there.
---
[1] https://github.com/linuxmint/Cinnamon/issues/7681
[-- Attachment #2: Type: text/html, Size: 2007 bytes --]
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-02 13:24 ` Robert Pluim
@ 2018-07-02 14:28 ` Carlos Pita
2018-07-02 17:44 ` Carlos Pita
0 siblings, 1 reply; 46+ messages in thread
From: Carlos Pita @ 2018-07-02 14:28 UTC (permalink / raw)
To: Robert Pluim; +Cc: 31968, Jonathan Kyle Mitchell
[-- Attachment #1: Type: text/plain, Size: 479 bytes --]
>
>
> FWIW I donʼt see this under kwin (I do have focus-follows-mouse, which
> might be influencing it).
>
As I mentioned elsewhere the effects seems to be very WM dependent. The
pair maximize-undecorate / unmaximize-decorate works fine on Cinnamon (but
not every other combination or sequence), maybe also under Plasma, but I
wouldn't count on it to continue working after a new release except the
developers explicitly supported the ability to change decorations.
[-- Attachment #2: Type: text/html, Size: 703 bytes --]
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-02 14:28 ` Carlos Pita
@ 2018-07-02 17:44 ` Carlos Pita
2018-07-02 20:03 ` Robert Pluim
0 siblings, 1 reply; 46+ messages in thread
From: Carlos Pita @ 2018-07-02 17:44 UTC (permalink / raw)
To: Robert Pluim; +Cc: 31968, Jonathan Kyle Mitchell
One more thing to take into account: after decorations are removed by
the WM because of _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED the undecorated
property is still nil in the frame alist. Maybe it's better for this
to be so, but I'm not so sure, after all the WM did remove the
decorations.
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-02 17:44 ` Carlos Pita
@ 2018-07-02 20:03 ` Robert Pluim
2018-07-02 22:29 ` Carlos Pita
0 siblings, 1 reply; 46+ messages in thread
From: Robert Pluim @ 2018-07-02 20:03 UTC (permalink / raw)
To: Carlos Pita; +Cc: 31968, Jonathan Kyle Mitchell
Carlos Pita <carlosjosepita@gmail.com> writes:
> One more thing to take into account: after decorations are removed by
> the WM because of _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED the undecorated
> property is still nil in the frame alist. Maybe it's better for this
> to be so, but I'm not so sure, after all the WM did remove the
> decorations.
Youʼre confusing a proof-of-concept patch with a final implementation
:-)
Actually, if _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED and '(undecorated t)
result in the same visuals, why donʼt we do the latter when we
maximize a frame (with a variable to control it of course). Does that
not avoid more of the differences between window managers?
Robert
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-02 20:03 ` Robert Pluim
@ 2018-07-02 22:29 ` Carlos Pita
2018-07-03 2:06 ` Carlos Pita
0 siblings, 1 reply; 46+ messages in thread
From: Carlos Pita @ 2018-07-02 22:29 UTC (permalink / raw)
To: Robert Pluim; +Cc: 31968, Jonathan Kyle Mitchell
> Youʼre confusing a proof-of-concept patch with a final implementation
> :-)
No, it's ok, it was meant to be just a heads up.
> Actually, if _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED and '(undecorated t)
> result in the same visuals, why donʼt we do the latter when we
> maximize a frame (with a variable to control it of course). Does that
> not avoid more of the differences between window managers?
See my previous email detailing why this might be a bad idea, namely:
unreliable response from WMs and no adequate hook in emacs. We have
control only over the second one.
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-02 22:29 ` Carlos Pita
@ 2018-07-03 2:06 ` Carlos Pita
2018-07-03 2:09 ` Carlos Pita
0 siblings, 1 reply; 46+ messages in thread
From: Carlos Pita @ 2018-07-03 2:06 UTC (permalink / raw)
To: Robert Pluim; +Cc: 31968, Jonathan Kyle Mitchell
[-- Attachment #1: Type: text/plain, Size: 122 bytes --]
Cinnamon just added support for _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED to muffin
after I requested it because of this issue!!!
[-- Attachment #2: Type: text/html, Size: 234 bytes --]
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-03 2:06 ` Carlos Pita
@ 2018-07-03 2:09 ` Carlos Pita
2018-07-03 23:35 ` Carlos Pita
0 siblings, 1 reply; 46+ messages in thread
From: Carlos Pita @ 2018-07-03 2:09 UTC (permalink / raw)
To: Robert Pluim; +Cc: 31968, Jonathan Kyle Mitchell
[-- Attachment #1: Type: text/plain, Size: 487 bytes --]
These are other desktop environments that I know are able to hide titlebars
on maximize as a WM setting: xfce, plasma, mate. I think if emacs goes the
way of setting _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED pretty much everything
will be covered (although not always in a per app basis).
On Mon, Jul 2, 2018, 11:06 PM Carlos Pita <carlosjosepita@gmail.com> wrote:
> Cinnamon just added support for _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED to
> muffin after I requested it because of this issue!!!
>
[-- Attachment #2: Type: text/html, Size: 929 bytes --]
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-07-03 2:09 ` Carlos Pita
@ 2018-07-03 23:35 ` Carlos Pita
0 siblings, 0 replies; 46+ messages in thread
From: Carlos Pita @ 2018-07-03 23:35 UTC (permalink / raw)
To: Robert Pluim; +Cc: 31968, Jonathan Kyle Mitchell
I've written this utility
https://github.com/memeplex/maximal
that uses xlib to handle creation events and set the
_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED for normal windows.
It comes with a few goodies: blacklist/whitelist, disable/resume, pip
installation, but nevertheless it's quite a humble script.
I mention it here because:
1. Someone reading this might want to get the feature before emacs 27.
2. Given that one can blacklist everything and whitelist just emacs,
it could be seen as a solution for this issue (although I understand
you might still want to implement it as a feature of emacs itself).
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2018-06-28 15:25 ` Robert Pluim
2018-06-29 8:42 ` martin rudalics
@ 2020-09-04 4:15 ` Lars Ingebrigtsen
2022-04-28 12:03 ` Lars Ingebrigtsen
2022-04-29 4:28 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 2 replies; 46+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-04 4:15 UTC (permalink / raw)
To: martin rudalics, 31968, Carlos Pita
Robert Pluim <rpluim@gmail.com> writes:
> Patch attached. It sets the correct property on my emacs frame for me,
> but it appears KWin ignores that, so I see no effect. No doubt needs a
> few more USE_GTK ifdef checks.
[...]
> +void
> +xg_set_hide_titlebar_when_maximized (struct frame *f, Lisp_Object hide)
Reading this thread, I'm not quite sure what the outcome was. It seemed
like this approach worked for Carlos in some environments, and in the
one it didn't work (Cinnamon), that one got support for it after he
reported that as a bug to the Cinnamon people?
So should something like this be added?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2020-09-04 4:15 ` Lars Ingebrigtsen
@ 2022-04-28 12:03 ` Lars Ingebrigtsen
2022-04-29 4:28 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 0 replies; 46+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-28 12:03 UTC (permalink / raw)
To: martin rudalics; +Cc: 31968, Carlos Pita
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Reading this thread, I'm not quite sure what the outcome was. It seemed
> like this approach worked for Carlos in some environments, and in the
> one it didn't work (Cinnamon), that one got support for it after he
> reported that as a bug to the Cinnamon people?
>
> So should something like this be added?
I tried Robert's patch in Emacs 29 with Gnome Shell and Debian/bookworm
with:
(x-set-hide-titlebar-when-maximized (selected-frame) t)
And the title bar was not hidden when maximised. To it seems like this
doesn't work reliably (any more).
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2020-09-04 4:15 ` Lars Ingebrigtsen
2022-04-28 12:03 ` Lars Ingebrigtsen
@ 2022-04-29 4:28 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-29 10:03 ` Lars Ingebrigtsen
1 sibling, 1 reply; 46+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-04-29 4:28 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 31968, martin rudalics, Carlos Pita
Lars Ingebrigtsen <larsi@gnus.org> writes:
> So should something like this be added?
I don't see why this feature cannot be implemented in Lisp by users who
want it. It seems extravagant to have it as a frame parameter in C,
especially one relying on an undocumented window property specific to
new versions of GTK that is not implemented by many window managers.
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2022-04-29 4:28 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-04-29 10:03 ` Lars Ingebrigtsen
2022-04-29 10:25 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 46+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-29 10:03 UTC (permalink / raw)
To: Po Lu; +Cc: 31968, Carlos Pita
Po Lu <luangruo@yahoo.com> writes:
> I don't see why this feature cannot be implemented in Lisp by users who
> want it. It seems extravagant to have it as a frame parameter in C,
> especially one relying on an undocumented window property specific to
> new versions of GTK that is not implemented by many window managers.
If I skimmed the thread correctly, the Lisp solutions led to some
"flickering" -- i.e., first we show the frame maximised with a title
bar, and then the callback hook is called, and then we remove the title
bar. So asking the WM to do it all in one operation seemed attractive.
But when that doesn't even work, then the in-Lisp solution seems like
the only option.
(Note that I haven't actually tested the Lisp solution.)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2022-04-29 10:03 ` Lars Ingebrigtsen
@ 2022-04-29 10:25 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-29 10:31 ` Lars Ingebrigtsen
0 siblings, 1 reply; 46+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-04-29 10:25 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 31968, martin rudalics, Carlos Pita
Lars Ingebrigtsen <larsi@gnus.org> writes:
> If I skimmed the thread correctly, the Lisp solutions led to some
> "flickering" -- i.e., first we show the frame maximised with a title
> bar, and then the callback hook is called, and then we remove the title
> bar. So asking the WM to do it all in one operation seemed attractive.
> But when that doesn't even work, then the in-Lisp solution seems like
> the only option.
BTW, the frame resize synchronization introduced recently might
alleviate the flicker in the Lisp-based solutions, though I don't see
any flicker with or without resize synchronization.
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2022-04-29 10:25 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-04-29 10:31 ` Lars Ingebrigtsen
2022-04-29 10:42 ` Lars Ingebrigtsen
2022-04-29 17:11 ` Juri Linkov
0 siblings, 2 replies; 46+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-29 10:31 UTC (permalink / raw)
To: Po Lu; +Cc: 31968, Carlos Pita
Po Lu <luangruo@yahoo.com> writes:
> BTW, the frame resize synchronization introduced recently might
> alleviate the flicker in the Lisp-based solutions, though I don't see
> any flicker with or without resize synchronization.
Let's see... this was the proposed code:
(defun hide-titlebar-when-maximized (frame)
(if (eq 'maximized (alist-get 'fullscreen (frame-parameters frame)))
(set-frame-parameter frame 'undecorated t)
(set-frame-parameter frame 'undecorated nil)))
(add-hook 'window-size-change-functions 'hide-titlebar-when-maximized)
And indeed -- I don't see any flickering, so this seems like a good
solution.
So I think I'll add `hide-titlebar-when-maximized' to Emacs 29, and then
document that as a possible value for `window-size-change-functions'.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2022-04-29 10:31 ` Lars Ingebrigtsen
@ 2022-04-29 10:42 ` Lars Ingebrigtsen
2022-04-29 17:11 ` Juri Linkov
1 sibling, 0 replies; 46+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-29 10:42 UTC (permalink / raw)
To: Po Lu; +Cc: 31968, Carlos Pita
Lars Ingebrigtsen <larsi@gnus.org> writes:
> So I think I'll add `hide-titlebar-when-maximized' to Emacs 29, and then
> document that as a possible value for `window-size-change-functions'.
Now done, so I'm closing this bug report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2022-04-29 10:31 ` Lars Ingebrigtsen
2022-04-29 10:42 ` Lars Ingebrigtsen
@ 2022-04-29 17:11 ` Juri Linkov
2022-04-29 18:57 ` Eli Zaretskii
1 sibling, 1 reply; 46+ messages in thread
From: Juri Linkov @ 2022-04-29 17:11 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Po Lu, 31968, Carlos Pita
> So I think I'll add `hide-titlebar-when-maximized' to Emacs 29, and then
> document that as a possible value for `window-size-change-functions'.
`window-size-change-functions' is a strange choice to react to the event
that maximizes the frame. Maybe there is a hook that reacts to frame changes?
^ permalink raw reply [flat|nested] 46+ messages in thread
* bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd)
2022-04-29 17:11 ` Juri Linkov
@ 2022-04-29 18:57 ` Eli Zaretskii
0 siblings, 0 replies; 46+ messages in thread
From: Eli Zaretskii @ 2022-04-29 18:57 UTC (permalink / raw)
To: Juri Linkov; +Cc: luangruo, 31968, larsi, carlosjosepita
> Date: Fri, 29 Apr 2022 20:11:47 +0300
> Cc: Po Lu <luangruo@yahoo.com>, 31968@debbugs.gnu.org,
> Carlos Pita <carlosjosepita@gmail.com>
>
> `window-size-change-functions' is a strange choice to react to the event
> that maximizes the frame.
When a frame changes its size, at least one of its windows changes
dimensions, so these functions are called.
^ permalink raw reply [flat|nested] 46+ messages in thread
end of thread, other threads:[~2022-04-29 18:57 UTC | newest]
Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-25 20:43 bug#31968: 26.1.50; Allow to hide title bar on maximize (gtk/gnome/csd) Carlos Pita
2018-06-27 10:07 ` Robert Pluim
2018-06-27 13:02 ` Carlos Pita
2018-06-27 13:25 ` Robert Pluim
2018-06-27 15:20 ` Carlos Pita
2018-06-28 4:22 ` Jonathan Kyle Mitchell
2018-06-28 8:02 ` martin rudalics
2018-06-28 12:23 ` Robert Pluim
2018-06-28 8:02 ` martin rudalics
2018-06-28 15:25 ` Robert Pluim
2018-06-29 8:42 ` martin rudalics
2018-06-29 8:48 ` Robert Pluim
2018-06-30 8:33 ` martin rudalics
2018-06-30 22:32 ` Jonathan Kyle Mitchell
2018-06-30 22:54 ` Carlos Pita
2018-06-30 23:25 ` Carlos Pita
2018-07-01 0:13 ` Carlos Pita
2018-07-01 9:04 ` martin rudalics
2018-07-01 17:23 ` Carlos Pita
2018-07-01 17:35 ` Carlos Pita
2018-07-01 17:46 ` Carlos Pita
2018-07-01 18:08 ` Carlos Pita
2018-07-02 13:24 ` Robert Pluim
2018-07-02 14:28 ` Carlos Pita
2018-07-02 17:44 ` Carlos Pita
2018-07-02 20:03 ` Robert Pluim
2018-07-02 22:29 ` Carlos Pita
2018-07-03 2:06 ` Carlos Pita
2018-07-03 2:09 ` Carlos Pita
2018-07-03 23:35 ` Carlos Pita
2018-07-02 9:13 ` martin rudalics
2018-07-02 13:21 ` Robert Pluim
2018-07-01 9:02 ` martin rudalics
2018-07-02 13:31 ` Robert Pluim
2018-07-02 14:22 ` Carlos Pita
2018-07-01 9:02 ` martin rudalics
2018-07-02 5:06 ` Jonathan Kyle Mitchell
2020-09-04 4:15 ` Lars Ingebrigtsen
2022-04-28 12:03 ` Lars Ingebrigtsen
2022-04-29 4:28 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-29 10:03 ` Lars Ingebrigtsen
2022-04-29 10:25 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-29 10:31 ` Lars Ingebrigtsen
2022-04-29 10:42 ` Lars Ingebrigtsen
2022-04-29 17:11 ` Juri Linkov
2022-04-29 18:57 ` Eli Zaretskii
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).