* Guix Emacs: use XRandr rather than Gdk?
@ 2019-02-11 3:33 Benjamin Slade
2019-02-12 14:20 ` Ludovic Courtès
2019-02-12 14:59 ` Ricardo Wurmus
0 siblings, 2 replies; 8+ messages in thread
From: Benjamin Slade @ 2019-02-11 3:33 UTC (permalink / raw)
To: Guix-devel
In both flown-blown GuixSD as well as Guix on a foreign distro, Guix's
Emacs seems to use "Gdk" rather than "XRandr" to get screen/monitor
information. Every other packaged version of Emacs I've tried uses
"XRandr" to get screen/monitor information. This is an issue because
"Gdk" apparently doesn't know about individual screens/monitors, but
only about the aggregate area, whereas "XRandr" returns individual
screen names (e.g. "DVI-1") and their respective areas. This means that,
on multi-monitor, where Emacs packages use the `frame.el` library, there
is no way of distinguishing screens/monitors (problematically for
packages which try to make reference to different screens,
e.g. https://gitlab.com/emacsomancer/equake ). I thought I'd start here,
since I've only found this behaviour on Guix, and `frame.el` doesn't
seem to be very forthcoming about how it decides whether to use 'Gdk' or 'XRandr'.
-Ben
--
Benjamin Slade - https://babbagefiles.xyz - https://slade.jnanam.net
`(pgp_fp: ,(21BA 2AE1 28F6 DF36 110A 0E9C A320 BBE8 2B52 EE19))
'(sent by mu4e on Emacs running under GNU/Linux . https://gnu.org )
`(Choose Linux ,(Choose Freedom) . https://linux.com )
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Guix Emacs: use XRandr rather than Gdk?
2019-02-11 3:33 Guix Emacs: use XRandr rather than Gdk? Benjamin Slade
@ 2019-02-12 14:20 ` Ludovic Courtès
2019-02-12 14:59 ` Ricardo Wurmus
1 sibling, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2019-02-12 14:20 UTC (permalink / raw)
To: Benjamin Slade; +Cc: Guix-devel
Hi Benjamin,
Benjamin Slade <beoram@gmail.com> skribis:
> In both flown-blown GuixSD as well as Guix on a foreign distro, Guix's
> Emacs seems to use "Gdk" rather than "XRandr" to get screen/monitor
> information. Every other packaged version of Emacs I've tried uses
> "XRandr" to get screen/monitor information. This is an issue because
> "Gdk" apparently doesn't know about individual screens/monitors, but
> only about the aggregate area, whereas "XRandr" returns individual
> screen names (e.g. "DVI-1") and their respective areas. This means that,
> on multi-monitor, where Emacs packages use the `frame.el` library, there
> is no way of distinguishing screens/monitors (problematically for
> packages which try to make reference to different screens,
> e.g. https://gitlab.com/emacsomancer/equake ). I thought I'd start here,
> since I've only found this behaviour on Guix, and `frame.el` doesn't
> seem to be very forthcoming about how it decides whether to use 'Gdk' or 'XRandr'.
Do you know what it would take to fix it? I suppose most Emacs users
would prefer the “correct” behavior. :-)
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Guix Emacs: use XRandr rather than Gdk?
2019-02-11 3:33 Guix Emacs: use XRandr rather than Gdk? Benjamin Slade
2019-02-12 14:20 ` Ludovic Courtès
@ 2019-02-12 14:59 ` Ricardo Wurmus
2019-02-12 15:22 ` Pierre Neidhardt
2019-02-14 3:09 ` Benjamin Slade
1 sibling, 2 replies; 8+ messages in thread
From: Ricardo Wurmus @ 2019-02-12 14:59 UTC (permalink / raw)
To: Benjamin Slade; +Cc: Guix-devel
Benjamin Slade <beoram@gmail.com> writes:
> I thought I'd start here, since I've only found this behaviour on
> Guix, and `frame.el` doesn't seem to be very forthcoming about how it
> decides whether to use 'Gdk' or 'XRandr'.
This is done by x-display-monitor-attributes-list, which is defined in
src/xfns.c. It uses Gdk when Emacs is configured to USE_GTK (the code
that sets the source to “Gdk” is in an #ifdef).
We build Emacs with GTK+, but … we may not need to do this as Emacs is
not a regular GTK client. I recall that there are other oddities when
using GTK, such as crashes when disconnecting from a remote Emacs
daemon, which only happens with a GTK build of Emacs.
There may be another way to get a fully graphical Emacs without having
to build with GTK.
--
Ricardo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Guix Emacs: use XRandr rather than Gdk?
2019-02-12 14:59 ` Ricardo Wurmus
@ 2019-02-12 15:22 ` Pierre Neidhardt
2019-02-12 16:19 ` Benjamin Slade
2019-02-14 3:09 ` Benjamin Slade
1 sibling, 1 reply; 8+ messages in thread
From: Pierre Neidhardt @ 2019-02-12 15:22 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: Guix-devel, Benjamin Slade
[-- Attachment #1: Type: text/plain, Size: 244 bytes --]
There are many other ways actually, Emacs also supports the Athena/Lucid toolkits, it
even has X support without toolkits (it's very ugly then...).
I don't know about the frame issue though.
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Guix Emacs: use XRandr rather than Gdk?
2019-02-12 15:22 ` Pierre Neidhardt
@ 2019-02-12 16:19 ` Benjamin Slade
0 siblings, 0 replies; 8+ messages in thread
From: Benjamin Slade @ 2019-02-12 16:19 UTC (permalink / raw)
To: Ricardo Wurmus, Guix-devel, Pierre Neidhardt
Thanks, all.
While it would be good if there was an easy Guix path to other builds of
Emacs (e.g. with the Lucid toolkit to avoid crashes when disconnecting
from a remote Emacs as Ricardo mentions), I don't think this is actually
the issue with `frame.el` using `Gdk` rather than `XRandr`.
The standard Emacs build elsewhere (Arch, Ubuntu etc.) also uses GTK+,
but `frame.el` still ends up using `XRandr`. So maybe there is some
other build (sub)option involved?
-Ben
--
Benjamin Slade - https://babbagefiles.xyz
`(pgp_fp: ,(21BA 2AE1 28F6 DF36 110A 0E9C A320 BBE8 2B52 EE19))
'(sent by mu4e on Emacs running under GNU/Linux . https://gnu.org )
`(Choose Linux ,(Choose Freedom) . https://linux.com )
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Guix Emacs: use XRandr rather than Gdk?
2019-02-12 14:59 ` Ricardo Wurmus
2019-02-12 15:22 ` Pierre Neidhardt
@ 2019-02-14 3:09 ` Benjamin Slade
2019-02-14 14:35 ` Pierre Neidhardt
1 sibling, 1 reply; 8+ messages in thread
From: Benjamin Slade @ 2019-02-14 3:09 UTC (permalink / raw)
To: Ricardo Wurmus, Guix-devel
Hi Ricardo & Guix-devel,
On 2019-02-12T07:59:13-0700, Ricardo Wurmus <rekado@elephly.net> wrote:
> This is done by x-display-monitor-attributes-list, which is defined
> in src/xfns.c. It uses Gdk when Emacs is configured to USE_GTK (the
> code that sets the source to “Gdk” is in an #ifdef).
> We build Emacs with GTK+, but … we may not need to do this as Emacs
> is not a regular GTK client. I recall that there are other oddities
> when using GTK, such as crashes when disconnecting from a remote
> Emacs daemon, which only happens with a GTK build of Emacs.
Looking into this, I suspect the issue is not building the GTK version
(though it would be nice to have a Lucid-toolkit/x11 build available
through Guix at some point as I think I prefer it to the GTK one), but
rather instead that (looking at `emacs.scm`) it seems that Guix isn't
building Emacs with `libxrandr` as one of the (optional) (build time?)
dependencies, and so `frames.el` falls back to using Gdk rather than
XRandr.
What do you think? I can try testing out this theory (i.e. that
including `libxrandr` in `emacs.scm` may be enough to remedy the issue)
at some point, but it may be another week or two before I'll have time
so to do.
-Ben
--
Benjamin Slade - https://babbagefiles.xyz - https://slade.jnanam.net
`(pgp_fp: ,(21BA 2AE1 28F6 DF36 110A 0E9C A320 BBE8 2B52 EE19))
'(sent by mu4e on Emacs running under GNU/Linux . https://gnu.org )
`(Choose Linux ,(Choose Freedom) . https://linux.com )
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Guix Emacs: use XRandr rather than Gdk?
2019-02-14 3:09 ` Benjamin Slade
@ 2019-02-14 14:35 ` Pierre Neidhardt
2019-02-18 4:54 ` Benjamin Slade
0 siblings, 1 reply; 8+ messages in thread
From: Pierre Neidhardt @ 2019-02-14 14:35 UTC (permalink / raw)
To: Benjamin Slade; +Cc: Guix-devel
[-- Attachment #1: Type: text/plain, Size: 93 bytes --]
Sounds like a good clue, please go ahead :)
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Guix Emacs: use XRandr rather than Gdk?
2019-02-14 14:35 ` Pierre Neidhardt
@ 2019-02-18 4:54 ` Benjamin Slade
0 siblings, 0 replies; 8+ messages in thread
From: Benjamin Slade @ 2019-02-18 4:54 UTC (permalink / raw)
To: Pierre Neidhardt, Ricardo Wurmus, Guix-devel
So it turns out that, indeed, adding `("libxrandr" ,libxrandr)` to
`inputs` is necessary but not sufficient to get Guix's Emacs to use
XRandr rather than Gdk.
Currently in Guix, there is the `emacs-no-x-toolkit` which actually is a
GUI version of Emacs, but not using any toolkit (so the menus etc are a
bit funky looking) - as it stands now this builds without either Gdk or
XRandr and so uses some sort of fallback for screen information. If I
add `("libxrandr" ,libxrandr)` to `inputs` (as per above) of the base
`emacs` build, then I can get this to use XRandr. And I successfully
created builds of Emacs using the Athena/Lucid toolkit and the
Lesstif* toolkit which also will use XRandr properly.
But Ricardo is right that something about the way that Guix is currently
building the GTK3 toolkit version of Emacs that results in it using Gdk
rather than XRandr. Ricardo mentioned:
> This is done by x-display-monitor-attributes-list, which is defined in
> src/xfns.c. It uses Gdk when Emacs is configured to USE_GTK (the code
> that sets the source to “Gdk” is in an #ifdef).
I'm not sure where the relevant #ifdef is or how to manipulate it.
I will work on creating a patch for the other toolkits, and to put the
libxrandr package in as an input, but it would be nice to get the
default GTK3 build to use XRandr as well. Again, I'm not quite sure
about how the Guix build is different:-- on Arch and Void, the default
GTK3 build uses XRandr, so I'm not sure what needs changing in the
current basic package build to get Guix to use XRandr rather than Gdk.
And it would be nice to include that in a patch too (even if the
Athena/Lucid build might be better in some ways).
-Ben
* For the sake of completeness, it would be nice to get it to build with
the Openmotif toolkit too, but that will need packaging itself for
Guix first.
--
Benjamin Slade - https://babbagefiles.xyz
`(pgp_fp: ,(21BA 2AE1 28F6 DF36 110A 0E9C A320 BBE8 2B52 EE19))
'(sent by mu4e on Emacs running under GNU/Linux . https://gnu.org )
`(Choose Linux ,(Choose Freedom) . https://linux.com )
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-02-18 4:54 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-11 3:33 Guix Emacs: use XRandr rather than Gdk? Benjamin Slade
2019-02-12 14:20 ` Ludovic Courtès
2019-02-12 14:59 ` Ricardo Wurmus
2019-02-12 15:22 ` Pierre Neidhardt
2019-02-12 16:19 ` Benjamin Slade
2019-02-14 3:09 ` Benjamin Slade
2019-02-14 14:35 ` Pierre Neidhardt
2019-02-18 4:54 ` Benjamin Slade
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.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).