[xmonad] Is there a way to reparent a window manually?

Brandon Allbery allbery.b at gmail.com
Sat Jul 24 19:08:28 UTC 2021


xev is useful for examining events, although it'll give you events for all
windows.

On Sat, Jul 24, 2021 at 2:59 PM Platon Pronko <platon7pronko at gmail.com>
wrote:

> Hi!
>
> Setting _NET_WORKAREA had no effect - Unity Editor menu glitches are still
> present (unplugged the second monitor to simplify the situation).
>
> I tried running Unity Editor under MATE+Xmonad, and I still see the
> glitches right after I run "xmonad --replace" (or kill marco directly and
> then start xmonad - same effect). I also tried running your full Xmonad
> config verbatim - no difference, still glitches.
>
> The idea about reparenting vs non-reparenting WMs seemed to be very
> promising, but since you are running Unity without glitches under Xmonad
> then that's probably not the issue.
>
> At this point I see only two possible sources of the glitches:
>
> 1. Different _NET_* properties. Seems that Marco sets additional
> properties _NET_DESKTOP_LAYOUT, _NET_DESKTOP_GEOMETRY and
> _NET_DESKTOP_VIEWPORT on the root window. On the Unity window it sets some
> more additional properties, most relevant seem to be _NET_FRAME_EXTENTS,
> _NET_WM_OPAQUE_REGION.
>
> 2. Different events sent to the window by window managers. Is there some
> WM-agnostic way to log events sent to a window in X? I think comparing
> event orders could be quite useful here.
>
> Best regards,
> Platon Pronko
>
> On 2021-07-24 20:10, Brandon Allbery wrote:
> > _NET_WORKAREA is set on the root window and attempts to describe all the
> desktops/workspaces. This doesn't work well in xmonad so I just describe
> each workspace the same way. It's relative to the upper left corner of the
> workspace, so should be independent of xrandr.
> >
> > logHook runs any time the focus or workspace changes.
> >
> > On Sat, Jul 24, 2021 at 12:58 PM Platon Pronko <platon7pronko at gmail.com
> <mailto:platon7pronko at gmail.com>> wrote:
> >
> >     Hi!
> >
> >     I checked with xprop, and I don't have _NET_WORKAREA set on my
> windows, so I do need to set it somehow. My situation is a bit complicated
> by having two monitors of different resolution arranged in a somewhat
> complex geometry:
> >
> >     xrandr --output HDMI-0 --auto --output HDMI-1 --auto --pos 2560x1440
> >
> >     (two outputs, one on the top-left, second down and to the right from
> it, with only corners connecting - this way the mouse does not jump to
> different screen by mistake)
> >
> >     Is there a way to handle _NET_WORKAREA properly in such situation?
> Will the logHook run each time my focus changes between windows, enabling
> me to set _NET_WORKAREA according to the current display I use?
> >
> >     Best regards,
> >     Platon Pronko
> >
> >     On 2021-07-24 19:39, Brandon Allbery wrote:
> >      > I'm doing it manually:
> https://github.com/geekosaur/xmonad.hs/blob/pyanfar/xmonad.hs#L356-L362 <
> https://github.com/geekosaur/xmonad.hs/blob/pyanfar/xmonad.hs#L356-L362> <
> https://github.com/geekosaur/xmonad.hs/blob/pyanfar/xmonad.hs#L356-L362 <
> https://github.com/geekosaur/xmonad.hs/blob/pyanfar/xmonad.hs#L356-L362>>
> which is run from the `logHook` and which I computed from the size of
> mate-panel. Note that I have panels at top and bottom so you'll want to
> account for that when comparing to what I computed.
> >      >
> >      > On Sat, Jul 24, 2021 at 12:27 PM Platon Pronko <
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>>> wrote:
> >      >
> >      >     Hi!
> >      >
> >      >      > But it almost looks like you're using something like
> DwmStyle as your layout, with that little tab up top including the program
> icon.
> >      >
> >      >     That's actually xfce4-panel, but it takes only a portion of
> the horizontal space - the other part is usually occupied by xmobar.
> >      >
> >      >      > I'm using MATE as my DE, for what it's worth.
> >      >
> >      >     Thanks for the tip, I'll check it out.
> >      >
> >      >     Actually, maybe my problems stem from the fact that I don't
> actually use most of XFCE? I only start xfce4-panel and xfce4-session - so
> basically XFCE has no say about the windows. "Full" xfce runs the Unity
> editor just fine.
> >      >
> >      >      > _NET_WORKAREA matters because some programs (notably
> anything using Qt/KDE) use it to place their menus.
> >      >
> >      >     How does one configure it properly? I tried searching for
> something related to _NET_WORKAREA, but it mostly find some unrelated
> discussions about initial implementation in Xmonad.
> >      >
> >      >     Best regards,
> >      >     Platon Pronko
> >      >
> >      >     On 2021-07-24 02:39, Brandon Allbery wrote:
> >      >      > Yeh, I can't reproduce that locally. ("Vindictive ways" is
> probably dependence on EWMH, which most programs do these days.) But it
> almost looks like you're using something like DwmStyle as your layout, with
> that little tab up top including the program icon.
> >      >      >
> >      >      > I'm using MATE as my DE, for what it's worth. (Unity
> Editor is not best pleased with it, but I assume that has more to do with
> being run on a 4GB laptop with low-end video.)
> >      >      >
> >      >      > _NET_WORKAREA matters because some programs (notably
> anything using Qt/KDE) use it to place their menus.
> >      >      >
> >      >      > On Fri, Jul 23, 2021 at 2:28 PM Platon Pronko <
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>>>> wrote:
> >      >      >
> >      >      >     Hi!
> >      >      >
> >      >      >      > I'm trying to reproduce your issues with my config,
> but I have no idea what I'm doing. Can you upload a sample I can try to
> work with?
> >      >      >
> >      >      >     I've attached the simplest config that still
> reproduces the problem (actually, the problem can be reproduced even with
> using `def` instead of `xfceConfig`, but then the system breaks in a
> vindictive ways). Also I'm attaching a screenshot that showcases the
> problem - see several "menus" being visible simultaneously.
> >      >      >
> >      >      >      > For what it's worth, I have the packages window
> open and, whether placed away from the window (via PlaceHook) or over it, I
> see no problems with menus in either window.
> >      >      >
> >      >      >     Maybe my problem is due to xmonad-xfce interactions?
> What DE are you running (if any)?
> >      >      >
> >      >      >      > (1) Your config does not have `ewmh` configured
> (this seems unlikely); or
> >      >      >
> >      >      >     Checked - I do have `ewmh` configured since I use
> `xfceConfig` (which builds upon `desktopConfig` which in turn applies
> `ewmh`).
> >      >      >
> >      >      >      > (2) you're having `_NET_WORKAREA` issues.
> >      >      >
> >      >      >     I'm not sure how to test this. Moreover, why
> _NET_WORKAREA should be related to sub-window repainting?
> >      >      >
> >      >      >     Best regards,
> >      >      >     Platon Pronko
> >      >      >
> >      >      >     On 2021-07-20 18:50, Brandon Allbery wrote:
> >      >      >      > I'm trying to reproduce your issues with my config,
> but I have no idea what I'm doing. Can you upload a sample I can try to
> work with?
> >      >      >      >
> >      >      >      > Someone who plays Mono-based games reports they
> work fine with xmonad,k so that may not be the problem. Two others I'm
> aware of are:
> >      >      >      >
> >      >      >      > (1) Your config does not have `ewmh` configured
> (this seems unlikely); or
> >      >      >      > (2) you're having `_NET_WORKAREA` issues.
> >      >      >      >
> >      >      >      > If it's EWMH, simply configuring the `ewmh`
> combinator should fix it. But quite a lot of stuff required EWMH these
> days, so I can't imagine you haven't run into this before.
> >      >      >      >
> >      >      >      > `_NET_WORKAREA` is complex. I'm told by other
> people that they have no problem with it (more correctly, without it), but
> I find I need to set it for some things (notably, KDE menus) to work
> properly. The difference may be that I have a status bar at the top of my
> screen.
> >      >      >      >
> >      >      >      > On Fri, Apr 23, 2021 at 11:05 AM Platon Pronko <
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>>> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>>>>> wrote:
> >      >      >      >
> >      >      >      >     Hi!
> >      >      >      >
> >      >      >      >     Tried adding all the event masks, no effect.
> Even more, even if I remove all events from the mask except X.ExposureMask
> then mouse movement and keyboard buttons still work.
> >      >      >      >
> >      >      >      >     Best regards,
> >      >      >      >     Platon Pronko
> >      >      >      >
> >      >      >      >     On 2021-04-23 01:07, Brandon Allbery wrote:
> >      >      >      >      > On Thu, Apr 22, 2021 at 3:28 AM Platon
> Pronko <platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>>> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>>>> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>>> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com> <mailto:
> platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>>
> >     <mailto:platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>
> <mailto:platon7pronko at gmail.com <mailto:platon7pronko at gmail.com>>>>>>
> wrote:
> >      >      >      >      >
> >      >      >      >      >     It seems that this could be happening
> due to XMonad being non-reparenting (I ran the same app under XFCE, and it
> seems to work okay).
> >      >      >      >      >
> >      >      >      >      >
> >      >      >      >      > This would not surprise me; it looks like
> they use Mono on Linux/Mac, and as yet there is no way to tell Mono that
> the window manager is non-reparenting so canvas widgets get messed up (they
> can't find themselves, since X11 uses window-relative addressing instead of
> screen-relative like Windows/.NET).
> >      >      >      >      >
> >      >      >      >      >     Any idea about what am I missing? Maybe
> my event masks are wrong?
> >      >      >      >      >
> >      >      >      >      >
> >      >      >      >      > You probably want all of the button-related
> events (see https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html>> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html>>> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html>> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html>>>> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html>
> >     <https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html>> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html>>> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html>> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html> <
> https://tronche.com/gui/x/xlib/events/mask.html <
> https://tronche.com/gui/x/xlib/events/mask.html>>>>>) so they'll be
> passed on to the child window.
> >      >      >      >      >
> >      >      >      >      > --
> >      >      >      >      > brandon s allbery kf8nh
> >      >      >      >      > allbery.b at gmail.com <mailto:
> allbery.b at gmail.com> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com>> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com>>> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com>> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com>>>> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com>> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com>>> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com>> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com> <mailto:allbery.b at gmail.com <mailto:
> allbery.b at gmail.com>>>>>
> >      >      >      >
> >      >      >      >
> >      >      >      >
> >      >      >      > --
> >      >      >      > brandon s allbery kf8nh
> >      >      >      > allbery.b at gmail.com <mailto:allbery.b at gmail.com>
> <mailto:allbery.b at gmail.com <mailto:allbery.b at gmail.com>> <mailto:
> allbery.b at gmail.com <mailto:allbery.b at gmail.com> <mailto:
> allbery.b at gmail.com <mailto:allbery.b at gmail.com>>> <mailto:
> allbery.b at gmail.com <mailto:allbery.b at gmail.com> <mailto:
> allbery.b at gmail.com <mailto:allbery.b at gmail.com>> <mailto:
> allbery.b at gmail.com <mailto:allbery.b at gmail.com> <mailto:
> allbery.b at gmail.com <mailto:allbery.b at gmail.com>>>>
> >      >      >
> >      >      >
> >      >      >
> >      >      > --
> >      >      > brandon s allbery kf8nh
> >      >      > allbery.b at gmail.com <mailto:allbery.b at gmail.com> <mailto:
> allbery.b at gmail.com <mailto:allbery.b at gmail.com>> <mailto:
> allbery.b at gmail.com <mailto:allbery.b at gmail.com> <mailto:
> allbery.b at gmail.com <mailto:allbery.b at gmail.com>>>
> >      >
> >      >
> >      >
> >      > --
> >      > brandon s allbery kf8nh
> >      > allbery.b at gmail.com <mailto:allbery.b at gmail.com> <mailto:
> allbery.b at gmail.com <mailto:allbery.b at gmail.com>>
> >
> >
> >
> > --
> > brandon s allbery kf8nh
> > allbery.b at gmail.com <mailto:allbery.b at gmail.com>
>


-- 
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/xmonad/attachments/20210724/801340d7/attachment-0001.html>


More information about the xmonad mailing list