From oneself at gmail.com Sat Jul 3 15:43:19 2021 From: oneself at gmail.com (Eyal Erez) Date: Sat, 3 Jul 2021 18:43:19 +0300 Subject: [xmonad] Full-screen messes up tabs on google chrome Message-ID: Hi, I've started encountering a strange issue with xmonad and google chrome. After a full-screen chrome (e.g. by watching a youtube video and hitting "f"), the top part of chrome goes behind xmobar. If I make a layout change or open another window or app then it pops back into place, but this is a little bit annoying. I have some screenshots to try and illustrate this issue: During full-screen: https://ibb.co/z4hjC31 Before full-screen: https://ibb.co/TPPgRVS After full-screen: https://ibb.co/Y2vK1Xq Is it my setup that's the problem? Is there any way to fix it? My config file as available here: https://controlc.com/09924e80 Thank you -- There are 10 types of people, those who know binary and those who don't. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomi at nomi.cz Sat Jul 3 15:49:10 2021 From: tomi at nomi.cz (Tomas Janousek) Date: Sat, 3 Jul 2021 17:49:10 +0200 Subject: [xmonad] Full-screen messes up tabs on google chrome In-Reply-To: References: Message-ID: Hi, On Sat, Jul 03, 2021 at 06:43:19PM +0300, Eyal Erez wrote: >I've started encountering a strange issue with xmonad and google chrome. >After a full-screen chrome (e.g. by watching a youtube video and hitting >"f"), the top part of chrome goes behind xmobar. If I make a layout change >or open another window or app then it pops back into place, but this is a >little bit annoying. I have some screenshots to try and illustrate this >issue: >[...] Looks like your xmobar isn't lowering itself on start. Do you have `lowerOnStart = False` or `overrideRedirect = False` in your .xmobarrc by any chance? -- Tomáš "liskin" ("Pivník") Janoušek, https://work.lisk.in/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From platon7pronko at gmail.com Sat Jul 3 16:06:10 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Sat, 3 Jul 2021 19:06:10 +0300 Subject: [xmonad] Full-screen messes up tabs on google chrome In-Reply-To: References: Message-ID: <22422e7c-ac92-6001-87c4-06a148ba2bdf@gmail.com> Hi! Minor nitpick - your "during" and "after" screenshots seem to be the same images (after-fullscreen). Regardless, I'm able to reproduce the issue my config as well (only on Chromium, for example Firefox does not have the same issue). The problem gets even worse if the inital browser window is smaller (e.g. half or quarter of the screen). Seems that the browser uses the full-screen size for positioning contents and does not get notification about the new window size in time. Testing similar scenario under XFCE does not trigger the bug. Looks like the issue is somewhere between Xorg/Xmonad sending the resize events and Chrome/Chromium handling them. Tomas, I tried your suggestion about xmobar - doesn't seem to be the issue, different settings had no effect. Best regards, Platon Pronko On 2021-07-03 18:43, Eyal Erez wrote: > Hi, > > I've started encountering a strange issue with xmonad and google chrome.  After a full-screen chrome (e.g. by watching a youtube video and hitting "f"), the top part of chrome goes behind xmobar.  If I make a layout change or open another window or app then it pops back into place, but this is a little bit annoying.  I have some screenshots to try and illustrate this issue: > > During full-screen: https://ibb.co/z4hjC31 > Before full-screen: https://ibb.co/TPPgRVS > After full-screen: https://ibb.co/Y2vK1Xq > > Is it my setup that's the problem? Is there any way to fix it?  My config file as available here: https://controlc.com/09924e80 > > Thank you > > -- > There are 10 types of people, those who know binary and those who don't. > > > _______________________________________________ > xmonad mailing list > xmonad at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad > From tomi at nomi.cz Sat Jul 3 16:10:51 2021 From: tomi at nomi.cz (Tomas Janousek) Date: Sat, 3 Jul 2021 18:10:51 +0200 Subject: [xmonad] Full-screen messes up tabs on google chrome In-Reply-To: <22422e7c-ac92-6001-87c4-06a148ba2bdf@gmail.com> References: <22422e7c-ac92-6001-87c4-06a148ba2bdf@gmail.com> Message-ID: Hi, On Sat, Jul 03, 2021 at 07:06:10PM +0300, Platon Pronko wrote: >Tomas, I tried your suggestion about xmobar - doesn't seem to be the issue, different settings had no effect. That's truly weird. Can you post your .xmobarrc and the output of `xwininfo -root -tree`? xmobar should be the last window in the list. One might also try `checkDock --> doLower` in their manageHook, which does the same thing as xmobar with lowering on start enabled. -- Tomáš "liskin" ("Pivník") Janoušek, https://work.lisk.in/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From platon7pronko at gmail.com Sat Jul 3 16:32:44 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Sat, 3 Jul 2021 19:32:44 +0300 Subject: [xmonad] Full-screen messes up tabs on google chrome In-Reply-To: References: <22422e7c-ac92-6001-87c4-06a148ba2bdf@gmail.com> Message-ID: Hi! I went even further - I killed xmobar entirely (and two another dock-like applications I use). The issue still persists if Chrome window is not occupying entire screen space (e.g. if it is tiled alongside another or was floated and resized). If the Chrome window occupies the entire screen space then the issue is not triggered. The issue is also not triggered if I run xmobar, but use win+B to toggle struts off (thus Chrome again occupies the entire screen space). Here's screenshots from my setup (without xmobar): Before fullscreen: https://ibb.co/5xHskxz During fullscreen: https://ibb.co/S509Rrr After fullscreen: https://ibb.co/gg6hYyZ The issue does not reproduce for you? Best regards, Platon Pronko On 2021-07-03 19:10, Tomas Janousek wrote: > Hi, > > On Sat, Jul 03, 2021 at 07:06:10PM +0300, Platon Pronko wrote: > > Tomas, I tried your suggestion about xmobar - doesn't seem to be the issue, different settings had no effect. > > That's truly weird. Can you post your .xmobarrc and the output of |xwininfo -root -tree|? xmobar should be the last window in the list. > > One might also try |checkDock --> doLower| in their manageHook, which does the same thing as xmobar with lowering on start enabled. > > -- > Tomáš "liskin" ("Pivník") Janoušek, https://work.lisk.in/ From tonyzorman at mailbox.org Sun Jul 4 05:27:38 2021 From: tonyzorman at mailbox.org (Tony Zorman) Date: Sun, 04 Jul 2021 07:27:38 +0200 Subject: [xmonad] Full-screen messes up tabs on google chrome In-Reply-To: References: <22422e7c-ac92-6001-87c4-06a148ba2bdf@gmail.com> Message-ID: <87v95q7inp.fsf@hyperspace> [[ I initially forgot to reply to the list so here is the email again for everyone to see. I apologize for the spam. Maybe the OP would also benefit from knowing about the windowedFullscreenFixEventHook ]] -------------------- Start of forwarded message -------------------- From: Tony Zorman To: Platon Pronko Subject: Re: [xmonad] Full-screen messes up tabs on google chrome Date: Sat, 03 Jul 2021 18:53:57 +0200 On Sat, Jul 03 2021 19:32, Platon Pronko wrote: > The issue still persists if Chrome window is not occupying entire > screen space (e.g. if it is tiled alongside another or was floated and > resized). > If the Chrome window occupies the entire screen space then the issue > is not triggered. The issue is also not triggered if I run xmobar, but > use win+B to toggle struts off (thus Chrome again occupies the entire > screen space). Xmobar not lowering itself and Chrome expecting to be given the full screen rectangle when being full-screened seem like orthogonal issues. In fact, the latter is a known and thing and there is a workaround in current HEAD in the form of X.U.Hacks.windowedFullscreenFixEventHook[1]. [1]: https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.16.999/XMonad-Util-Hacks.html#v:windowedFullscreenFixEventHook -------------------- End of forwarded message -------------------- From oneself at gmail.com Sun Jul 4 11:19:33 2021 From: oneself at gmail.com (Eyal Erez) Date: Sun, 4 Jul 2021 14:19:33 +0300 Subject: [xmonad] Full-screen messes up tabs on google chrome In-Reply-To: <87v95q7inp.fsf@hyperspace> References: <22422e7c-ac92-6001-87c4-06a148ba2bdf@gmail.com> <87v95q7inp.fsf@hyperspace> Message-ID: Thank you very much for looking into this so quickly and deeply. Do I need to wait for the workaround to be available in a released version of xmonad-contrib? Do I need to do something after upgrading to fix this? Thank you, On Sun, Jul 4, 2021 at 8:27 AM Tony Zorman wrote: > [[ I initially forgot to reply to the list so here is the email again > for everyone to see. I apologize for the spam. Maybe the OP would > also benefit from knowing about the windowedFullscreenFixEventHook ]] > > -------------------- Start of forwarded message -------------------- > From: Tony Zorman > To: Platon Pronko > Subject: Re: [xmonad] Full-screen messes up tabs on google chrome > Date: Sat, 03 Jul 2021 18:53:57 +0200 > > On Sat, Jul 03 2021 19:32, Platon Pronko wrote: > > The issue still persists if Chrome window is not occupying entire > > screen space (e.g. if it is tiled alongside another or was floated and > > resized). > > If the Chrome window occupies the entire screen space then the issue > > is not triggered. The issue is also not triggered if I run xmobar, but > > use win+B to toggle struts off (thus Chrome again occupies the entire > > screen space). > > Xmobar not lowering itself and Chrome expecting to be given the full > screen rectangle when being full-screened seem like orthogonal issues. > In fact, the latter is a known and thing and there is a workaround in > current HEAD in the form of X.U.Hacks.windowedFullscreenFixEventHook[1]. > > [1]: > https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.16.999/XMonad-Util-Hacks.html#v:windowedFullscreenFixEventHook > -------------------- End of forwarded message -------------------- > -- *Eyal Erez <**oneself at gmail.com* *>* There are 10 types of people, those who know binary and those who don't. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tonyzorman at mailbox.org Sun Jul 4 12:36:45 2021 From: tonyzorman at mailbox.org (Tony Zorman) Date: Sun, 04 Jul 2021 14:36:45 +0200 Subject: [xmonad] Full-screen messes up tabs on google chrome In-Reply-To: References: <22422e7c-ac92-6001-87c4-06a148ba2bdf@gmail.com> <87v95q7inp.fsf@hyperspace> Message-ID: <87r1ge6ysi.fsf@hyperspace> On Sun, Jul 04 2021 14:19, Eyal Erez wrote: > Thank you very much for looking into this so quickly and deeply. Like I said, I'm not sure that this is actually your issue (though it certainly fixes *one* issue that people often have with Chrome). > Do I need to wait for the workaround to be available in a released version > of xmonad-contrib? Do I need to do something after upgrading to fix > this? You need to add this to your event hook once it is available (the documentation should tell you how to do this). Waiting for a new release is not strictly necessary, you can also compile the git version of xmonad-contrib yourself. From oneself at gmail.com Fri Jul 9 14:14:54 2021 From: oneself at gmail.com (Eyal Erez) Date: Fri, 9 Jul 2021 17:14:54 +0300 Subject: [xmonad] Managing Multiple Displays Message-ID: Hi, I often use multiple displays. Here are some configurations that I've used with my laptop: 1. Laptop monitor only 2. External monitor only (laptop lid closed) 3. External and laptop monitor at the same time. 4. Two external monitors (laptop lid closed). In order to show display correctly (which monitor is to the right/left of which and which is on/off) and shift trayer around to the right monitor and position, I've written a script that parses the output of xrandr, figures out if the laptop lid is open or not, then calls xrandr again to activate the right monitors and kills and relaunches trayer and places it in the correct position. I launch this script from a keybinding configured in xmonad.hs. This works, however, it has several disadvantages. The first is that adding a new configuration is a bit tedious -- this doesn't happen very often so it's not a huge deal. The other is that I can only activate the script if my screen is unlocked. This means that if my laptop is suspended and I want to disconnect the external monitor and put it in my bag for later use, I need to first wake it up, unlock it, launch the script to turn the laptop monitor on, and then put it away. Otherwise, I'll be staring at a blank screen when I turn it on and have to guess what to press to unlock and use the script. I was wondering how others deal with this challenge? Are there other, more well-built tools, than the script I have to do this more robustly and automatically? Thank you, -- There are 10 types of people, those who know binary and those who don't. -------------- next part -------------- An HTML attachment was scrubbed... URL: From yecine.megdiche at gmail.com Fri Jul 9 15:14:34 2021 From: yecine.megdiche at gmail.com (Yecine Megdiche) Date: Fri, 9 Jul 2021 17:14:34 +0200 Subject: [xmonad] Managing Multiple Displays In-Reply-To: References: Message-ID: Hello, if you're using the git version of xmonad-contrib, you're in luck: the new XMonad.Hooks.StatusBar module caters to that use case. It has built-in functionality to make status bars (or anything, really) react to changes in the screen configuration. This is achieved by defining a function that maps a screen id to "IO StatusBarConfig", which then gets passed to dynamicSBs. That takes care of appropriately setting the handleEventHook, startupHook and logHook. I hope it works! Yecine On Fri, 9 Jul 2021 at 16:16, Eyal Erez wrote: > Hi, > > I often use multiple displays. Here are some configurations that I've > used with my laptop: > 1. Laptop monitor only > 2. External monitor only (laptop lid closed) > 3. External and laptop monitor at the same time. > 4. Two external monitors (laptop lid closed). > > In order to show display correctly (which monitor is to the right/left of > which and which is on/off) and shift trayer around to the right monitor and > position, I've written a script that parses the output of xrandr, figures > out if the laptop lid is open or not, then calls xrandr again to activate > the right monitors and kills and relaunches trayer and places it in the > correct position. I launch this script from a keybinding configured in > xmonad.hs. > > This works, however, it has several disadvantages. The first is that > adding a new configuration is a bit tedious -- this doesn't happen very > often so it's not a huge deal. The other is that I can only activate the > script if my screen is unlocked. This means that if my laptop is suspended > and I want to disconnect the external monitor and put it in my bag for > later use, I need to first wake it up, unlock it, launch the script to turn > the laptop monitor on, and then put it away. Otherwise, I'll be staring at > a blank screen when I turn it on and have to guess what to press to unlock > and use the script. > > I was wondering how others deal with this challenge? Are there other, > more well-built tools, than the script I have to do this more robustly and > automatically? > > Thank you, > -- > There are 10 types of people, those who know binary and those who don't. > > _______________________________________________ > xmonad mailing list > xmonad at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rdiaz02 at gmail.com Fri Jul 9 19:31:04 2021 From: rdiaz02 at gmail.com (Ramon Diaz-Uriarte) Date: Fri, 09 Jul 2021 21:31:04 +0200 Subject: [xmonad] Managing Multiple Displays In-Reply-To: References: Message-ID: <87o8bbxp1j.fsf@gmail.com> Dear Eyal, For the "This means that if my laptop is suspended and I want to disconnect the external monitor and put it in my bag for later use, I need to first wake it up, unlock it, launch the script to turn the laptop monitor on, and then put it away. " why not have a script that, on resuming from suspension, calls your already working script? This should work even if your screen is locked. I have a very ugly kludge in a script that does that. I no longer use more than one monitor at a time (my neck did not like it), but I work either with the laptop connected to an external monitor or just with the laptop monitor, and I can easily switch from one to another with suspend events (and all suspend events include locking) in between. When I resume from suspension, the script is called so that it uses the external monitor if the laptop is plugged to it (and the monitor is on), or the laptop otherwise. My script is called by a service file I placed as /etc/systemd/system/configure_monitors.service (I can send you the service file and my script kludge, but the later is just a bunch of calls to xrandr to figure out what is connected, and then configure the screens). Best, R. On Fri, 09-July-2021, at 16:14:54, Eyal Erez wrote: > Hi, > > I often use multiple displays. Here are some configurations that I've used > with my laptop: > 1. Laptop monitor only > 2. External monitor only (laptop lid closed) > 3. External and laptop monitor at the same time. > 4. Two external monitors (laptop lid closed). > > In order to show display correctly (which monitor is to the right/left of > which and which is on/off) and shift trayer around to the right monitor and > position, I've written a script that parses the output of xrandr, figures > out if the laptop lid is open or not, then calls xrandr again to activate > the right monitors and kills and relaunches trayer and places it in the > correct position. I launch this script from a keybinding configured in > xmonad.hs. > > This works, however, it has several disadvantages. The first is that > adding a new configuration is a bit tedious -- this doesn't happen very > often so it's not a huge deal. The other is that I can only activate the > script if my screen is unlocked. This means that if my laptop is suspended > and I want to disconnect the external monitor and put it in my bag for > later use, I need to first wake it up, unlock it, launch the script to turn > the laptop monitor on, and then put it away. Otherwise, I'll be staring at > a blank screen when I turn it on and have to guess what to press to unlock > and use the script. > > I was wondering how others deal with this challenge? Are there other, more > well-built tools, than the script I have to do this more robustly and > automatically? > > Thank you, -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-25 Facultad de Medicina Universidad Autónoma de Madrid Arzobispo Morcillo, 4 28029 Madrid Spain Phone: +34-91-497-2412 Email: rdiaz02 at gmail.com ramon.diaz at iib.uam.es https://ligarto.org/rdiaz From eye at eyenx.ch Sat Jul 10 06:23:54 2021 From: eye at eyenx.ch (eye) Date: Sat, 10 Jul 2021 08:23:54 +0200 Subject: [xmonad] Managing Multiple Displays In-Reply-To: <87o8bbxp1j.fsf@gmail.com> References: <87o8bbxp1j.fsf@gmail.com> Message-ID: Hi Eyal For automating xrandr and making sure it configures the Monitors (not xmonad) right I use autorandr [1] not sure how that works with laptop lid close tho. Regards Toni [1] https://github.com/phillipberndt/autorandr On 9 July 2021 21:31:04 CEST, Ramon Diaz-Uriarte wrote: >Dear Eyal, > >For the "This means that if my laptop is suspended and I want to >disconnect >the external monitor and put it in my bag for later use, I need to >first >wake it up, unlock it, launch the script to turn the laptop monitor on, >and >then put it away. " > >why not have a script that, on resuming from suspension, calls your >already >working script? This should work even if your screen is locked. > > >I have a very ugly kludge in a script that does that. > >I no longer use more than one monitor at a time (my neck did not like >it), >but I work either with the laptop connected to an external monitor or >just >with the laptop monitor, and I can easily switch from one to another >with >suspend events (and all suspend events include locking) in between. >When I >resume from suspension, the script is called so that it uses the >external >monitor if the laptop is plugged to it (and the monitor is on), or the >laptop otherwise. > >My script is called by a service file I placed as >/etc/systemd/system/configure_monitors.service (I can send you the >service >file and my script kludge, but the later is just a bunch of calls to >xrandr to >figure out what is connected, and then configure the screens). > >Best, > > >R. > > > > > > >On Fri, 09-July-2021, at 16:14:54, Eyal Erez wrote: >> Hi, >> >> I often use multiple displays. Here are some configurations that >I've used >> with my laptop: >> 1. Laptop monitor only >> 2. External monitor only (laptop lid closed) >> 3. External and laptop monitor at the same time. >> 4. Two external monitors (laptop lid closed). >> >> In order to show display correctly (which monitor is to the >right/left of >> which and which is on/off) and shift trayer around to the right >monitor and >> position, I've written a script that parses the output of xrandr, >figures >> out if the laptop lid is open or not, then calls xrandr again to >activate >> the right monitors and kills and relaunches trayer and places it in >the >> correct position. I launch this script from a keybinding configured >in >> xmonad.hs. >> >> This works, however, it has several disadvantages. The first is that >> adding a new configuration is a bit tedious -- this doesn't happen >very >> often so it's not a huge deal. The other is that I can only activate >the >> script if my screen is unlocked. This means that if my laptop is >suspended >> and I want to disconnect the external monitor and put it in my bag >for >> later use, I need to first wake it up, unlock it, launch the script >to turn >> the laptop monitor on, and then put it away. Otherwise, I'll be >staring at >> a blank screen when I turn it on and have to guess what to press to >unlock >> and use the script. >> >> I was wondering how others deal with this challenge? Are there >other, more >> well-built tools, than the script I have to do this more robustly and >> automatically? >> >> Thank you, From mekeor.melire at gmail.com Sun Jul 11 10:14:30 2021 From: mekeor.melire at gmail.com (mekeor.melire at gmail.com) Date: Sun, 11 Jul 2021 12:14:30 +0200 Subject: [xmonad] Managing Multiple Displays In-Reply-To: References: Message-ID: <87bl79xi23.fsf@gmail.com> Hello :) My solution: I have a keybinding which rotates through monitor-configurations. When plug-in a new monitor, or unplug a monitor or so, I keep pressing that keybinding until it fits the new monitor setup. It's not beautiful code, but here it is: This is the keybinding: ``` ("M-S-s" , do ownState <- XS.get let newMonitorLayoutIndex = (monitorLayoutIndex ownState + 1) `mod` (length Host.monitorLayouts) spawn (monitorLayouts !! newMonitorLayoutIndex) XS.put (ownState { monitorLayoutIndex = newMonitorLayoutIndex }) refresh) ``` The `monitorLayouts` variable is just a list of xrandr-commands as strings. (I generate those via `arandr`.) The monitor-state is a state-property: ``` data OwnState = OwnState { monitorLayoutIndex :: Int } deriving Typeable instance ExtensionClass OwnState where initialValue = OwnState { orientation = OrientB , keyboardLayout = De , monitorLayoutIndex = 0 } ``` I show the monitor-state in my dock, dzen2: ``` ownPPConfig statusbar = def { ppExtras = [ Just . show . monitorLayoutIndex <$> XS.get ] } ``` Kind regards Mekeor 2021-07-09 / 17:14 / oneself at gmail.com: > Hi, > > I often use multiple displays. Here are some configurations that I've used with my laptop: > 1. Laptop monitor only > 2. External monitor only (laptop lid closed) > 3. External and laptop monitor at the same time. > 4. Two external monitors (laptop lid closed). > > In order to show display correctly (which monitor is to the right/left of which and which is on/off) and shift trayer around to the right monitor and position, I've written a script that parses the output of xrandr, figures out if the laptop lid is open or not, then calls xrandr > again to activate the right monitors and kills and relaunches trayer and places it in the correct position. I launch this script from a keybinding configured in xmonad.hs. > > This works, however, it has several disadvantages. The first is that adding a new configuration is a bit tedious -- this doesn't happen very often so it's not a huge deal. The other is that I can only activate the script if my screen is unlocked. This means that if my laptop is > suspended and I want to disconnect the external monitor and put it in my bag for later use, I need to first wake it up, unlock it, launch the script to turn the laptop monitor on, and then put it away. Otherwise, I'll be staring at a blank screen when I turn it on and have to > guess what to press to unlock and use the script. > > I was wondering how others deal with this challenge? Are there other, more well-built tools, than the script I have to do this more robustly and automatically? > > Thank you, From tomi at nomi.cz Tue Jul 13 11:22:42 2021 From: tomi at nomi.cz (Tomas Janousek) Date: Tue, 13 Jul 2021 12:22:42 +0100 Subject: [xmonad] Managing Multiple Displays In-Reply-To: References: Message-ID: Hi, On Fri, Jul 09, 2021 at 05:14:54PM +0300, Eyal Erez wrote: >I often use multiple displays. Here are some configurations that I've used >with my laptop: >[…] >I was wondering how others deal with this challenge? Are there other, more >well-built tools, than the script I have to do this more robustly and >automatically? There are many ways to do this. I'll describe my setup and then point to some alternatives. --- I have [a script](https://work.lisk.in/2020/10/11/xrandr-ux.html) that extends xrandr command-line usage so that I can just write a generic vertical layout like so: xrandr-smart --output 'eDP-*' --auto \ --output '!(eDP-*)' --auto --above 'eDP-*' Then I have [another script](https://github.com/liskin/dotfiles/blob/home/bin/layout-auto) that lets me save layouts for [specific configurations](https://github.com/liskin/dotfiles/tree/home/bin/.xlayout) of connected monitors. This one is invoked automatically whenever an output is connected/disconnected, using . I can also invoke it manually via a keybinding to force a laptop-only layout, or to force an automatic multi-head layout in an unknown setup. If I need something extra (like external monitor only for games), I just invoke a "layout-extonly" script via [rofi](https://github.com/davatorium/rofi) (I only need to type "ex" for it to know what I mean). (Re)starting xmobars and trayers is handled by https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.16.999/XMonad-Hooks-StatusBar.html#v:dynamicSBs, as mentioned by Yecine earlier. In my setup, the automatic switching doesn't happen when the screen is locked, and neither do the keybindings work, but that is just my paranoia (and yeah, I should just use https://packages.debian.org/experimental/cryptsetup-suspend instead :-)). It's totally possible to let X.H.Rescreen invoke the script even if locked, and [xsecurelock](https://github.com/google/xsecurelock) allows configuration of keybindings when the screen is locked. --- Now for the alternatives: Others have mentioned autorandr. That is probably what most minimalist window manager users use. Autorandr can be invoked on output (dis)connect, lid open/close and suspend/resume in various ways: * https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.16.999/XMonad-Hooks-Rescreen.html#v:addRandrChangeHook * https://github.com/jceb/srandrd * https://github.com/phillipberndt/autorandr/blob/master/contrib/autorandr_launcher/autorandr_launcher.c * https://github.com/phillipberndt/autorandr/blob/master/contrib/listen_lid.sh * https://github.com/phillipberndt/autorandr/blob/master/contrib/pm-utils/40autorandr Also see https://wiki.archlinux.org/title/xrandr for other tools and tips. -- Tomáš "liskin" ("Pivník") Janoušek, https://work.lisk.in/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From platon7pronko at gmail.com Thu Jul 15 05:44:06 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Thu, 15 Jul 2021 08:44:06 +0300 Subject: [xmonad] question about code in XMonad.Actions.GridSelect Message-ID: <35c4e60d-001d-bd62-45be-4b76ade15e7f@gmail.com> Hi! I'm looking at XMonad.Actions.GridSelect code (wanted to fix compilation warnings), and I stumbled over the following function. -- | Generates a Double from a string, trying to -- achieve a random distribution. -- We create a random seed from the sum of all characters -- in the string, and use it to generate a ratio between 0 and 1 stringToRatio :: String -> Double stringToRatio "" = 0 stringToRatio s = let gen = mkStdGen $ sum $ map fromEnum s range = (\(a, b) -> b - a) $ genRange gen randomInt = foldr1 combine $ replicate 20 next combine f1 f2 g = let (_, g') = f1 g in f2 g' in fi (fst $ randomInt gen) / fi range Looks like it is supposed to simply generate a Double number between 0 and 1 - why such complicated approach was used instead of `uniformR` from System.Random? (also it seems that it is buggy and returns huge negative numbers, because `range = (\(a, b) -> b - a) $ genRange gen` is always -1. Best regards, Platon Pronko From platon7pronko at gmail.com Thu Jul 15 07:31:00 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Thu, 15 Jul 2021 10:31:00 +0300 Subject: [xmonad] question about code in XMonad.Actions.GridSelect In-Reply-To: <874kcw2gb1.fsf@hyperspace> References: <35c4e60d-001d-bd62-45be-4b76ade15e7f@gmail.com> <874kcw2gb1.fsf@hyperspace> Message-ID: Hi! I'm working on a PR right now. I've implemented the fix already, but I have trouble with tests - `stack test` uses random-1.1, and uniformR is not found there. Should I use randomR instead? Alternatively, how can I specify that a newer version of random should be used? Best regards, Platon Pronko On 2021-07-15 10:21, Solid wrote: > Hi, > > On Thu, Jul 15 2021 08:44, Platon Pronko wrote: >> Looks like it is supposed to simply generate a Double number between 0 >> and 1 - why such complicated approach was used instead of `uniformR` >> from System.Random? > > this was implemented all the way back in ~2008 it seems; barely anyone > from that era is still around, so I doubt you'll get a satisfying answer > to _why_ :) > > The `uniformR` function didn't exist back then, but `randomR` certainly > did; I don't quite know why it was implemented in this convoluted way. > I would definitely welcome a pr that fixes this, if you're so inclined. > From platon7pronko at gmail.com Thu Jul 15 08:34:00 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Thu, 15 Jul 2021 11:34:00 +0300 Subject: [xmonad] question about code in XMonad.Actions.GridSelect In-Reply-To: <87zguo0ynq.fsf@hyperspace> References: <35c4e60d-001d-bd62-45be-4b76ade15e7f@gmail.com> <874kcw2gb1.fsf@hyperspace> <87zguo0ynq.fsf@hyperspace> Message-ID: <05607555-4d0b-6466-8b11-b563a2d73c50@gmail.com> I've decided to just go with randomR, simpler and guaranteed to work. Here's the PR: https://github.com/xmonad/xmonad-contrib/pull/573 P.S. I don't see an attachment in your email. But if there was simply an addition of "random >= 1.2" to build-depends (library and tests), then I've already tried and stack gave me lots of new errors (apparently the ghc snapshot it downloaded already includes random-1.1?). Best regards, Platon Pronko On 2021-07-15 11:27, Solid wrote: > On Thu, Jul 15 2021 10:31, Platon Pronko wrote: >> Should I use randomR instead? Alternatively, how can I specify that a >> newer version of random should be used? > > AFAIK you just have to specify that in the cabal file. I've attached a > diff that should probably work. > > The main thing is to test whether this works with all of the GHC > versions that we support (which is back to 8.4.4 right now). If that's > the case then I have no objections to raising the version bounds for > random—especially for random actually; the library has gotten a dearly > needed overhaul with 1.2. > From platon7pronko at gmail.com Thu Jul 15 10:27:05 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Thu, 15 Jul 2021 13:27:05 +0300 Subject: [xmonad] question about code in XMonad.Actions.GridSelect In-Reply-To: <87v95b2801.fsf@hyperspace> References: <35c4e60d-001d-bd62-45be-4b76ade15e7f@gmail.com> <874kcw2gb1.fsf@hyperspace> <87zguo0ynq.fsf@hyperspace> <05607555-4d0b-6466-8b11-b563a2d73c50@gmail.com> <87v95b2801.fsf@hyperspace> Message-ID: Ah, yes, stack recommended to add it to extra deps. But I got scared of the long "sha256:30d72d..." string, wanted to keep it much simpler since I'm new here. I think if we want to update random then it would make sense to do it in separate PR - I can do it if you'd like. Best regards, Platon Pronko On 2021-07-15 13:20, Solid wrote: > On Thu, Jul 15 2021 11:34, Platon Pronko wrote: >> I've decided to just go with randomR, simpler and guaranteed to >> work. Here's the PR: > > You're probably right; though the whole Random class is (soft) > deprecated. Quoting from the docs[1] > >> Random exists primarily for backwards compatibility with version 1.1 >> of this library. In new code, use the better specified Uniform and >> UniformRange instead. > >> P.S. I don't see an attachment in your email. But if there was simply an addition of >> "random >= 1.2" to build-depends (library and tests), then I've already tried and >> stack gave me lots of new errors (apparently the ghc snapshot it downloaded >> already includes random-1.1?). > > Ah, silly me; sorry. Should be attached now. If it's not on stackage > yet, you also have to add the version to the extra-deps. > > [1]: https://hackage.haskell.org/package/random-1.2.0/docs/System-Random.html#v:randomR > From platon7pronko at gmail.com Thu Jul 15 11:17:55 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Thu, 15 Jul 2021 14:17:55 +0300 Subject: [xmonad] question about code in XMonad.Actions.GridSelect In-Reply-To: References: <35c4e60d-001d-bd62-45be-4b76ade15e7f@gmail.com> <874kcw2gb1.fsf@hyperspace> <87zguo0ynq.fsf@hyperspace> <05607555-4d0b-6466-8b11-b563a2d73c50@gmail.com> <87v95b2801.fsf@hyperspace> Message-ID: <35c02aa8-43a3-9199-b257-a85553891049@gmail.com> It looks like actually "properly" upgrading to the newer package version is going to be harder than adding a package version to cabal file. Stack uses "resolvers" configured to fetch packages from a specific Haskell LTS, currently it's 17.14 and it includes older version of `random` package. Best regards, Platon Pronko On 2021-07-15 13:27, Platon Pronko wrote: > Ah, yes, stack recommended to add it to extra deps. But I got scared > of the long "sha256:30d72d..." string, wanted to keep it much simpler > since I'm new here. > > I think if we want to update random then it would make sense to do it in > separate PR - I can do it if you'd like. > > Best regards, > Platon Pronko > > On 2021-07-15 13:20, Solid wrote: >> On Thu, Jul 15 2021 11:34, Platon Pronko wrote: >>> I've decided to just go with randomR, simpler and guaranteed to >>> work. Here's the PR: >> >> You're probably right; though the whole Random class is (soft) >> deprecated.  Quoting from the docs[1] >> >>> Random exists primarily for backwards compatibility with version 1.1 >>> of this library. In new code, use the better specified Uniform and >>> UniformRange instead. >> >>> P.S. I don't see an attachment in your email. But if there was simply an addition of >>> "random >= 1.2" to build-depends (library and tests), then I've already tried and >>> stack gave me lots of new errors (apparently the ghc snapshot it downloaded >>> already includes random-1.1?). >> >> Ah, silly me; sorry.  Should be attached now.  If it's not on stackage >> yet, you also have to add the version to the extra-deps. >> >> [1]: https://hackage.haskell.org/package/random-1.2.0/docs/System-Random.html#v:randomR >> From oneself at gmail.com Tue Jul 20 12:23:21 2021 From: oneself at gmail.com (Eyal Erez) Date: Tue, 20 Jul 2021 15:23:21 +0300 Subject: [xmonad] Managing Multiple Displays In-Reply-To: References: Message-ID: Thank you all for the wonderful suggestions. There are definitely many good options available that I was not aware of. I've tried a few and autorandr seems like a good addition into my already (more or less) working workflow. It solves the specific problem that I've described. In the future, I might try and replace my custom script with a different end-to-end solution. On Tue, Jul 13, 2021 at 2:22 PM Tomas Janousek wrote: > Hi, > > On Fri, Jul 09, 2021 at 05:14:54PM +0300, Eyal Erez wrote: > > I often use multiple displays. Here are some configurations that I've used > {.quotelead}>with my laptop: > > […] > I was wondering how others deal with this challenge? Are there other, more > well-built tools, than the script I have to do this more robustly and > automatically? > > There are many ways to do this. I'll describe my setup and then point to > some alternatives. > ------------------------------ > > I have a script that > extends xrandr command-line usage so that I can just write a generic > vertical layout like so: > > xrandr-smart --output 'eDP-*' --auto \ > --output '!(eDP-*)' --auto --above 'eDP-*' > > Then I have another script > that lets > me save layouts for specific configurations > of connected > monitors. This one is invoked automatically whenever an output is > connected/disconnected, using > https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.16.999/XMonad-Hooks-Rescreen.html#v:addRandrChangeHook > . > I can also invoke it manually via a keybinding to force a laptop-only > layout, or to force an automatic multi-head layout in an unknown setup. If > I need something extra (like external monitor only for games), I just > invoke a "layout-extonly" script via rofi > (I only need to type "ex" for it to > know what I mean). > > (Re)starting xmobars and trayers is handled by > https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.16.999/XMonad-Hooks-StatusBar.html#v:dynamicSBs, > as mentioned by Yecine earlier. > > In my setup, the automatic switching doesn't happen when the screen is > locked, and neither do the keybindings work, but that is just my paranoia > (and yeah, I should just use > https://packages.debian.org/experimental/cryptsetup-suspend instead :-)). > It's totally possible to let X.H.Rescreen invoke the script even if locked, > and xsecurelock allows > configuration of keybindings when the screen is locked. > ------------------------------ > > Now for the alternatives: > > Others have mentioned autorandr. That is probably what most minimalist > window manager users use. Autorandr can be invoked on output (dis)connect, > lid open/close and suspend/resume in various ways: > > - > https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.16.999/XMonad-Hooks-Rescreen.html#v:addRandrChangeHook > - https://github.com/jceb/srandrd > - > https://github.com/phillipberndt/autorandr/blob/master/contrib/autorandr_launcher/autorandr_launcher.c > - > https://github.com/phillipberndt/autorandr/blob/master/contrib/listen_lid.sh > - > https://github.com/phillipberndt/autorandr/blob/master/contrib/pm-utils/40autorandr > > Also see https://wiki.archlinux.org/title/xrandr for other tools and tips. > -- > Tomáš "liskin" ("Pivník") Janoušek, https://work.lisk.in/ > -- *Eyal Erez <**oneself at gmail.com* *>* There are 10 types of people, those who know binary and those who don't. -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Tue Jul 20 15:50:06 2021 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 20 Jul 2021 11:50:06 -0400 Subject: [xmonad] Is there a way to reparent a window manually? In-Reply-To: References: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> Message-ID: 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 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 > 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>) so they'll be passed on > to the child window. > > > > -- > > brandon s allbery kf8nh > > allbery.b at gmail.com > -- brandon s allbery kf8nh allbery.b at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominik.schrempf at gmail.com Tue Jul 20 19:40:16 2021 From: dominik.schrempf at gmail.com (Dominik Schrempf) Date: Tue, 20 Jul 2021 21:40:16 +0200 Subject: [xmonad] Managing Multiple Displays In-Reply-To: References: Message-ID: <6161B3D7-1375-4293-9057-7020341EB22A@gmail.com> Not sure if this is out of place, but do you know grobi? It works great for me! Dominik GitHub - fd0/grobi: Automatically configure monitors/outputs for Xorg via RANDR – https://github.com/fd0/grobi On July 20, 2021 2:23:21 PM GMT+02:00, Eyal Erez wrote: >Thank you all for the wonderful suggestions. There are definitely many >good options available that I was not aware of. > >I've tried a few and autorandr seems like a good addition into my >already >(more or less) working workflow. It solves the specific problem that >I've >described. In the future, I might try and replace my custom script >with a >different end-to-end solution. > > > >On Tue, Jul 13, 2021 at 2:22 PM Tomas Janousek wrote: > >> Hi, >> >> On Fri, Jul 09, 2021 at 05:14:54PM +0300, Eyal Erez wrote: >> >> I often use multiple displays. Here are some configurations that I've >used >> {.quotelead}>with my laptop: >> >> […] >> I was wondering how others deal with this challenge? Are there other, >more >> well-built tools, than the script I have to do this more robustly and >> automatically? >> >> There are many ways to do this. I'll describe my setup and then point >to >> some alternatives. >> ------------------------------ >> >> I have a script that >> extends xrandr command-line usage so that I can just write a generic >> vertical layout like so: >> >> xrandr-smart --output 'eDP-*' --auto \ >> --output '!(eDP-*)' --auto --above 'eDP-*' >> >> Then I have another script >> that >lets >> me save layouts for specific configurations >> of >connected >> monitors. This one is invoked automatically whenever an output is >> connected/disconnected, using >> >https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.16.999/XMonad-Hooks-Rescreen.html#v:addRandrChangeHook >> . >> I can also invoke it manually via a keybinding to force a laptop-only >> layout, or to force an automatic multi-head layout in an unknown >setup. If >> I need something extra (like external monitor only for games), I just >> invoke a "layout-extonly" script via rofi >> (I only need to type "ex" for it >to >> know what I mean). >> >> (Re)starting xmobars and trayers is handled by >> >https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.16.999/XMonad-Hooks-StatusBar.html#v:dynamicSBs, >> as mentioned by Yecine earlier. >> >> In my setup, the automatic switching doesn't happen when the screen >is >> locked, and neither do the keybindings work, but that is just my >paranoia >> (and yeah, I should just use >> https://packages.debian.org/experimental/cryptsetup-suspend instead >:-)). >> It's totally possible to let X.H.Rescreen invoke the script even if >locked, >> and xsecurelock allows >> configuration of keybindings when the screen is locked. >> ------------------------------ >> >> Now for the alternatives: >> >> Others have mentioned autorandr. That is probably what most >minimalist >> window manager users use. Autorandr can be invoked on output >(dis)connect, >> lid open/close and suspend/resume in various ways: >> >> - >> >https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.16.999/XMonad-Hooks-Rescreen.html#v:addRandrChangeHook >> - https://github.com/jceb/srandrd >> - >> >https://github.com/phillipberndt/autorandr/blob/master/contrib/autorandr_launcher/autorandr_launcher.c >> - >> >https://github.com/phillipberndt/autorandr/blob/master/contrib/listen_lid.sh >> - >> >https://github.com/phillipberndt/autorandr/blob/master/contrib/pm-utils/40autorandr >> >> Also see https://wiki.archlinux.org/title/xrandr for other tools and >tips. >> -- >> Tomáš "liskin" ("Pivník") Janoušek, https://work.lisk.in/ >> > > >-- >*Eyal Erez <**oneself at gmail.com* *>* > >There are 10 types of people, those who know binary and those who >don't. -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Tue Jul 20 22:29:59 2021 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 20 Jul 2021 18:29:59 -0400 Subject: [xmonad] Is there a way to reparent a window manually? In-Reply-To: References: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> Message-ID: 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. On Tue, Jul 20, 2021 at 11:50 AM 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 > 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 > > 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>) so they'll be passed >> on to the child window. >> > >> > -- >> > brandon s allbery kf8nh >> > allbery.b at gmail.com >> > > > -- > brandon s allbery kf8nh > allbery.b at gmail.com > -- brandon s allbery kf8nh allbery.b at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From platon7pronko at gmail.com Fri Jul 23 18:28:56 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Fri, 23 Jul 2021 21:28:56 +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! > 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 > 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 >> 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 > > > > > -- > brandon s allbery kf8nh > allbery.b at gmail.com -------------- next part -------------- A non-text attachment was scrubbed... Name: unity_menus.png Type: image/png Size: 242017 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: xmonad.hs Type: text/x-haskell Size: 140 bytes Desc: not available URL: From allbery.b at gmail.com Fri Jul 23 23:39:12 2021 From: allbery.b at gmail.com (Brandon Allbery) Date: Fri, 23 Jul 2021 19:39:12 -0400 Subject: [xmonad] Is there a way to reparent a window manually? In-Reply-To: References: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> Message-ID: 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 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 > 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 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>>) so they'll be passed > on to the child window. > > > > > > -- > > > brandon s allbery kf8nh > > > allbery.b at gmail.com allbery.b at gmail.com > > > > > > > > > -- > > brandon s allbery kf8nh > > allbery.b at gmail.com > -- brandon s allbery kf8nh allbery.b at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From platon7pronko at gmail.com Sat Jul 24 16:27:44 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Sat, 24 Jul 2021 19:27:44 +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: <6ad0f780-2965-ca77-6bd6-983b050e8297@gmail.com> 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 > 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 >> 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 > >>> 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 > >> > > > > > > > > -- > > brandon s allbery kf8nh > > allbery.b at gmail.com > > > > > -- > brandon s allbery kf8nh > allbery.b at gmail.com From allbery.b at gmail.com Sat Jul 24 16:39:48 2021 From: allbery.b at gmail.com (Brandon Allbery) Date: Sat, 24 Jul 2021 12:39:48 -0400 Subject: [xmonad] Is there a way to reparent a window manually? In-Reply-To: <6ad0f780-2965-ca77-6bd6-983b050e8297@gmail.com> References: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> <6ad0f780-2965-ca77-6bd6-983b050e8297@gmail.com> Message-ID: I'm doing it manually: 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 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 > 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 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 platon7pronko at gmail.com > platon7pronko at gmail.com 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>>>) so they'll be passed > on to the child window. > > > > > > > > -- > > > > brandon s allbery kf8nh > > > > allbery.b at gmail.com allbery.b at gmail.com > allbery.b at gmail.com allbery.b at gmail.com >> > > > > > > > > > > > > -- > > > brandon s allbery kf8nh > > > allbery.b at gmail.com allbery.b at gmail.com > > > > > > > > > -- > > brandon s allbery kf8nh > > allbery.b at gmail.com > -- brandon s allbery kf8nh allbery.b at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From platon7pronko at gmail.com Sat Jul 24 16:58:38 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Sat, 24 Jul 2021 19:58:38 +0300 Subject: [xmonad] Is there a way to reparent a window manually? In-Reply-To: References: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> <6ad0f780-2965-ca77-6bd6-983b050e8297@gmail.com> Message-ID: <250de320-7504-b99b-884c-ed75692b49d6@gmail.com> 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 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 > 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 >> 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 > >>> 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 > >> > >>>> 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 > >> > >>> > >      > > >      > > >      > > >      > -- > >      > brandon s allbery kf8nh > >      > allbery.b at gmail.com > >> > > > > > > > > -- > > brandon s allbery kf8nh > > allbery.b at gmail.com > > > > > -- > brandon s allbery kf8nh > allbery.b at gmail.com From allbery.b at gmail.com Sat Jul 24 17:10:38 2021 From: allbery.b at gmail.com (Brandon Allbery) Date: Sat, 24 Jul 2021 13:10:38 -0400 Subject: [xmonad] Is there a way to reparent a window manually? In-Reply-To: <250de320-7504-b99b-884c-ed75692b49d6@gmail.com> References: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> <6ad0f780-2965-ca77-6bd6-983b050e8297@gmail.com> <250de320-7504-b99b-884c-ed75692b49d6@gmail.com> Message-ID: _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 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> > 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 > 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 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 platon7pronko at gmail.com > platon7pronko at gmail.com 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 platon7pronko at gmail.com > platon7pronko at gmail.com platon7pronko at gmail.com >> platon7pronko at gmail.com platon7pronko at gmail.com > platon7pronko at gmail.com 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>>>>) so they'll be passed > on to the child window. > > > > > > > > > > -- > > > > > brandon s allbery kf8nh > > > > > allbery.b at gmail.com > > allbery.b at gmail.com allbery.b at gmail.com >> allbery.b at gmail.com allbery.b at gmail.com > allbery.b at gmail.com allbery.b at gmail.com >>> > > > > > > > > > > > > > > > > -- > > > > brandon s allbery kf8nh > > > > allbery.b at gmail.com allbery.b at gmail.com > allbery.b at gmail.com allbery.b at gmail.com >> > > > > > > > > > > > > -- > > > brandon s allbery kf8nh > > > allbery.b at gmail.com allbery.b at gmail.com > > > > > > > > > -- > > brandon s allbery kf8nh > > allbery.b at gmail.com > -- brandon s allbery kf8nh allbery.b at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From platon7pronko at gmail.com Sat Jul 24 18:59:24 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Sat, 24 Jul 2021 21:59:24 +0300 Subject: [xmonad] Is there a way to reparent a window manually? In-Reply-To: References: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> <6ad0f780-2965-ca77-6bd6-983b050e8297@gmail.com> <250de320-7504-b99b-884c-ed75692b49d6@gmail.com> Message-ID: <94130525-639b-e451-dd80-f51b107ab104@gmail.com> 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 > 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 > 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 >> 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 > >>> 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 > >> > >>>> 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 > >> > >>> > >> > > >>>>> 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 > >> > >>> > >> > >>>> > >      >      > > >      >      > > >      >      > > >      >      > -- > >      >      > brandon s allbery kf8nh > >      >      > allbery.b at gmail.com > >> > >>> > >      > > >      > > >      > > >      > -- > >      > brandon s allbery kf8nh > >      > allbery.b at gmail.com > >> > > > > > > > > -- > > brandon s allbery kf8nh > > allbery.b at gmail.com > > > > > -- > brandon s allbery kf8nh > allbery.b at gmail.com From platon7pronko at gmail.com Sat Jul 24 19:04:40 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Sat, 24 Jul 2021 22:04:40 +0300 Subject: [xmonad] tweaking xmonad into a reparenting window manager Message-ID: Hi! Is there some fundamental reason why Xmonad is non-reparenting? My current (naive) understanding is that Xmonad does not reparent the windows simply as a small optimization (why create a second window if you can live with one window just fine). If that's the case, then adding a tweak that allows Xmonad to do reparenting should be doable. However I understand that it will be non-trivial undertaking, so I wanted advice of more experienced developers before I sink in a lot of time to find out that this is fundamentally impossible for some reason. Best regards, Platon Pronko From allbery.b at gmail.com Sat Jul 24 19:08:28 2021 From: allbery.b at gmail.com (Brandon Allbery) Date: Sat, 24 Jul 2021 15:08:28 -0400 Subject: [xmonad] Is there a way to reparent a window manually? In-Reply-To: <94130525-639b-e451-dd80-f51b107ab104@gmail.com> References: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> <6ad0f780-2965-ca77-6bd6-983b050e8297@gmail.com> <250de320-7504-b99b-884c-ed75692b49d6@gmail.com> <94130525-639b-e451-dd80-f51b107ab104@gmail.com> Message-ID: 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 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 > 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 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 platon7pronko at gmail.com > platon7pronko at gmail.com 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 platon7pronko at gmail.com > platon7pronko at gmail.com platon7pronko at gmail.com >> platon7pronko at gmail.com platon7pronko at gmail.com > platon7pronko at gmail.com 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 > platon7pronko at gmail.com platon7pronko at gmail.com >> platon7pronko at gmail.com platon7pronko at gmail.com > platon7pronko at gmail.com platon7pronko at gmail.com >>> platon7pronko at gmail.com platon7pronko at gmail.com > platon7pronko at gmail.com platon7pronko at gmail.com >> platon7pronko at gmail.com 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>>>>>) so they'll be > passed on to the child window. > > > > > > > > > > > > -- > > > > > > brandon s allbery kf8nh > > > > > > allbery.b at gmail.com allbery.b at gmail.com> allbery.b at gmail.com>> allbery.b at gmail.com> allbery.b at gmail.com>>> allbery.b at gmail.com> allbery.b at gmail.com>> allbery.b at gmail.com> allbery.b at gmail.com>>>> allbery.b at gmail.com> allbery.b at gmail.com>> allbery.b at gmail.com> allbery.b at gmail.com>>> allbery.b at gmail.com> allbery.b at gmail.com>> allbery.b at gmail.com> allbery.b at gmail.com>>>>> > > > > > > > > > > > > > > > > > > > > -- > > > > > brandon s allbery kf8nh > > > > > allbery.b at gmail.com > > allbery.b at gmail.com allbery.b at gmail.com >> allbery.b at gmail.com allbery.b at gmail.com > allbery.b at gmail.com allbery.b at gmail.com >>> > > > > > > > > > > > > > > > > -- > > > > brandon s allbery kf8nh > > > > allbery.b at gmail.com allbery.b at gmail.com > allbery.b at gmail.com allbery.b at gmail.com >> > > > > > > > > > > > > -- > > > brandon s allbery kf8nh > > > allbery.b at gmail.com allbery.b at gmail.com > > > > > > > > > -- > > brandon s allbery kf8nh > > allbery.b at gmail.com > -- brandon s allbery kf8nh allbery.b at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Sat Jul 24 19:12:42 2021 From: allbery.b at gmail.com (Brandon Allbery) Date: Sat, 24 Jul 2021 15:12:42 -0400 Subject: [xmonad] tweaking xmonad into a reparenting window manager In-Reply-To: References: Message-ID: It's not fundamental, it's just that it's rather more than a "tweak" — many things assume the client window is directly a parent of the root, and would need to be taught about frame windows. On Sat, Jul 24, 2021 at 3:05 PM Platon Pronko wrote: > Hi! > > Is there some fundamental reason why Xmonad is non-reparenting? > > My current (naive) understanding is that Xmonad does not reparent the > windows simply as a small optimization (why create a second window if you > can live with one window just fine). If that's the case, then adding a > tweak that allows Xmonad to do reparenting should be doable. However I > understand that it will be non-trivial undertaking, so I wanted advice of > more experienced developers before I sink in a lot of time to find out that > this is fundamentally impossible for some reason. > > Best regards, > Platon Pronko > _______________________________________________ > xmonad mailing list > xmonad at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad > -- brandon s allbery kf8nh allbery.b at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From zev at bewilderbeest.net Mon Jul 26 05:22:21 2021 From: zev at bewilderbeest.net (Zev Weiss) Date: Mon, 26 Jul 2021 00:22:21 -0500 Subject: [xmonad] Is there a way to reparent a window manually? In-Reply-To: <250de320-7504-b99b-884c-ed75692b49d6@gmail.com> References: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> <6ad0f780-2965-ca77-6bd6-983b050e8297@gmail.com> <250de320-7504-b99b-884c-ed75692b49d6@gmail.com> Message-ID: On Sat, Jul 24, 2021 at 11:58:38AM CDT, Platon Pronko 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) > This is completely tangential and off-topic, and you may be entirely happy with your setup (which is fine if so), but if you're interested in trying out an alternative solution to the problem of the mouse pointer unwantedly jumping between displays, I might suggest this thing I wrote and have been using myself for a while: https://github.com/zevweiss/xdpb Zev From platon7pronko at gmail.com Mon Jul 26 05:55:41 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Mon, 26 Jul 2021 08:55:41 +0300 Subject: [xmonad] Is there a way to reparent a window manually? In-Reply-To: References: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> <6ad0f780-2965-ca77-6bd6-983b050e8297@gmail.com> <250de320-7504-b99b-884c-ed75692b49d6@gmail.com> Message-ID: <1c5520e5-a7b8-c83f-264e-2b050d3ab647@gmail.com> Hi! Thanks for a suggestion. Indeed I'm quite happy with my setup at the moment, but I will keep this alternative approach in mind. Best regards, Platon Pronko On 2021-07-26 08:22, Zev Weiss wrote: > On Sat, Jul 24, 2021 at 11:58:38AM CDT, Platon Pronko 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) >> > > This is completely tangential and off-topic, and you may be entirely happy with your setup (which is fine if so), but if you're interested in trying out an alternative solution to the problem of the mouse pointer unwantedly jumping between displays, I might suggest this thing I wrote and have been using myself for a while: https://github.com/zevweiss/xdpb > > > Zev > From platon7pronko at gmail.com Mon Jul 26 09:00:41 2021 From: platon7pronko at gmail.com (Platon Pronko) Date: Mon, 26 Jul 2021 12:00:41 +0300 Subject: [xmonad] Is there a way to reparent a window manually? In-Reply-To: References: <2af52179-7f9e-9483-07b8-ca17d5474d78@gmail.com> <6ad0f780-2965-ca77-6bd6-983b050e8297@gmail.com> <250de320-7504-b99b-884c-ed75692b49d6@gmail.com> <94130525-639b-e451-dd80-f51b107ab104@gmail.com> Message-ID: Hi! Tried debugging the issue some more. 1. _NET_* settings have no effect - verified this by excising them from the marco code and running this recompiled marco. 2. Used `xev -id 0x...` to check the events on the sub-windows was slightly useful, but I failed to glean much information from it. Seems that running xev in `-id` mode is a bit limited, because no MotionNotify or Key events are logged (maybe some limitations when listening for events from other windows?). The event lists were very similar, except that XMonad sends an additional Expose event to the window that should be redrawn (and it seems that the window completely ignores this event and does not redraw itself). 3. Verified that non-reparenting is definitely not an issue - used simple reparenting window manager (from https://github.com/jichu4n/basic_wm), and observed the same glitches. 4. At this point I would be completely satisfied with some simple solution that would just programmatically force the redraw of the entire window (and then I will be able to add it to some xdotool script). But my attempts to force redraws on the window by sending different events have failed (I've attached a python script with my code). Best regards, Platon Pronko On 2021-07-24 22:08, Brandon Allbery wrote: > 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 > 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 >> 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 > >> 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 > >>> 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 > >> > >>>> 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 > >> > >>> > >> > > >>>>> 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 > >> > >>> > >> > >>>> > >> > >>> > >> > >      > >>>>>> 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 > >> > >>> > >> > >>>> > >> > >>> > >> > >>>>> > >      >      >      > > >      >      >      > > >      >      >      > > >      >      >      > -- > >      >      >      > brandon s allbery kf8nh > >      >      >      > allbery.b at gmail.com > >> > >>> > >> > >>>> > >      >      > > >      >      > > >      >      > > >      >      > -- > >      >      > brandon s allbery kf8nh > >      >      > allbery.b at gmail.com > >> > >>> > >      > > >      > > >      > > >      > -- > >      > brandon s allbery kf8nh > >      > allbery.b at gmail.com > >> > > > > > > > > -- > > brandon s allbery kf8nh > > allbery.b at gmail.com > > > > > -- > brandon s allbery kf8nh > allbery.b at gmail.com -------------- next part -------------- A non-text attachment was scrubbed... Name: send_event.py Type: text/x-python Size: 942 bytes Desc: not available URL: