From platon7pronko at gmail.com Thu Apr 22 07:27:53 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Thu, 22 Apr 2021 10:27:53 +0300 Subject: [xmonad] Is there a way to reparent a window manually? Message-ID: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> Hi! I'm trying to run Unity Editor under XMonad. Unfortunately I'm having issues - sub-windows of the main window are not redrawn properly, resulting in ugly mess (previously-opened menu lists do not disappear, etc). 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). Is there a way to reparent a window manually? I tried creating a new X window via Python and Xlib, as in this example: https://rosettacode.org/wiki/Window_creation/X11#Python and then reparenting the window to it via `xdotool windowreparent` and subsequently `xdotool windowmap` plus `xdotool windowsize`. It partially worked - the app window correctly resized to fill the parent window, seems to be reacting to mouse move and mouse scroll events (interface elements are highlighted), reacts to keyboard events, but completely ignores mouse button events (clicks/drags). I'm attaching create_window.py script I used to create the window. Any idea about what am I missing? Maybe my event masks are wrong? Best regards, Platon Pronko -------------- next part -------------- A non-text attachment was scrubbed... Name: create_window.py Type: text/x-python Size: 768 bytes Desc: not available URL: From allbery.b at gmail.com Thu Apr 22 22:07:31 2021 From: allbery.b at gmail.com (Brandon Allbery) Date: Thu, 22 Apr 2021 18:07:31 -0400 Subject: [xmonad] Is there a way to reparent a window manually? In-Reply-To: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> References: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> Message-ID: On Thu, Apr 22, 2021 at 3:28 AM Platon Pronko 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) so they'll be passed on to the child window. -- brandon s allbery kf8nh allbery.b at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From platon7pronko at gmail.com Fri Apr 23 15:05:20 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Fri, 23 Apr 2021 18:05:20 +0300 Subject: [xmonad] Is there a way to reparent a window manually? In-Reply-To: References: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> Message-ID: 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 > 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 ) so they'll be passed on to the child window. > > -- > brandon s allbery kf8nh > allbery.b at gmail.com