Re: Emacs's set-frame-size can not work well with gnome-shell?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Emacs's set-frame-size can not work well with gnome-shell?

Dmitry Gutov
On 06.04.2020 12:03, martin rudalics wrote:
> I pushed the non-Lisp changes to the release branch and the mouse.el
> changes to master.

Thanks, Martin! That should improve the experience of many users of
childframe based popups.

Do you want to write a "here's what we ended up doing" comment for the
GNOME bug tracker?

If the fact that we had to use a legacy function doesn't spur anybody to
action, I don't know what could.

Reply | Threaded
Open this post in threaded view
|

Re: Emacs's set-frame-size can not work well with gnome-shell?

Adrián Medraño Calvo
(Please correct mail address in CC to this one in further responses.)

> On 8. Apr 2020, at 10:45, martin rudalics <[hidden email]> wrote:
>
> > Have you tried the _NET_SUPPORTING_WM_CHECK window’s _NET_WM_NAME?
>
> I'm struggling with that for quite some time already.  wmctrl uses it
> but I never got anything from a call like
>
>  rc = XGetWindowProperty (dpy, dpyinfo->root_window,
>   XInternAtom (dpy, "_NET_WM_NAME", False),
>                           0, max_len, False, XA_STRING,
> /**   XInternAtom (dpy, "UTF8_STRING", False), **/
>                           &actual_type, &actual_format, &actual_size,
>                           &bytes_remaining, &name);
>
> It reports success but name remains NULL.  If you have any clues about
> what I'm doing wrong I'd be all ears.
>
> martin
>


This works for me:

~~~
(let ((id (x-window-property "_NET_SUPPORTING_WM_CHECK" nil "WINDOW" 0 nil t)))
  (x-window-property "_NET_WM_NAME" nil "UTF8_STRING" id nil))
~~~

I can’t help translating to Xlib API, but it’s there in Emacs C code.

You can also check with xwininfo and xprop:

~~~
$ xwininfo -root
xwininfo: Window id: 0x111 (the root window) (has no name)
[…]
$ xprop -id 0x111
[…]
_NET_SUPPORTING_WM_CHECK(WINDOW): window id # 0x600002
[…]
$ xprop -id 0x600002
_NET_WM_NAME(UTF8_STRING) = "whatever"
~~~

Hope it helps,
Adrián.
Reply | Threaded
Open this post in threaded view
|

Re: Emacs's set-frame-size can not work well with gnome-shell?

martin rudalics
 > This works for me:
 >
 > ~~~
 > (let ((id (x-window-property "_NET_SUPPORTING_WM_CHECK" nil "WINDOW" 0 nil t)))
 >    (x-window-property "_NET_WM_NAME" nil "UTF8_STRING" id nil))
 > ~~~

Works here as well, indeed.  Apparently one has to go through
that _NET_SUPPORTING_WM_CHECK before asking for _NET_WM_NAME.

 > Hope it helps,
 > Adrián.

Thanks, martin