Need workaround to properly resize Gnome Apps
Bug is being tracked upstream here: https://bugzilla.gnome.org/show_bug.cgi?id=766496
When moving Nautilus, Gedit and other Gnome apps they are not moving to the proper location. They are off by x:23, y:23 w=-46 h:-46. If I first call window.set_shadow_width(0,0,0,0), then immediately call window.move_resize(...) just as before, they are moving to the correct location and width.
The move_resize() function is including the shadow width when moving. This is only happening on Gnome apps though. For example terminator and google_chrome are moved as expected when calling move_resize() even without calling set_shadow_width(0,0,0,0).
I am running on Ubuntu Gnome 16.04 and see problem on both Gnome 3.18 and 3.20.
Matthias Clasen [gtk+ developer] 2016-05-23 10:54:24 UTC So you are dealing with foreign windows. GTK is not a window manager toolkit, so it does not offer many functions to get information about foreign windows. Your best bet is to read the _GTK_FRAME_EXTENTS property on the X window.
This is slightly icky, but maybe the best option for now is to have a configuration option to enable or disable the shadow workaround we need for Gnome but others don't want on XFCE.
Thanks for looking into this. So I assume the _GTK_FRAME_EXTENTS avenue was a non-starter?
Is there something that developers of gnome/python apps can do in order to make pygrid work on them, without materially compromising the apps? A line of code in their apps which reads shadow extents and makes them available to pygrid etc? I realise this would mean all apps had to change, however if it can be boiled down to a single universal line, feasibly devs would be amenable to including it in their next commit...? Maybe??
I'm not sure actually, I never wrote a gnome app myself. My only guess would be to remove the shadow on your app, but that also seems like it wouldn't be an app specific setting to me either. There may also be something else going on.. the workaround to call window.set_shadow_width(0,0,0,0) is still in the code, so maybe its padding or something causing your specific app to not resize correctly.
Interestingly, I just installed catfish from the Ubuntu repo and it is respecting zero spacing for me (Ubuntu 18.04).
That IS interesting. Possibly the repo is older; the newer builds have moved to python install style, not sure if that would/should change anything... Certainly a recent commit concerned remembering window placement which feasibly meant playing with similar elements that pygrid uses...? Be interested to know if the latest version also works for you but doesn't for me. Cheers for looking into this!
Still working for me on catfish 1.4.7.

well.... shit. Guess I'll have another bash around at this when I'm back at my linux box this weekend. Cheers Michael
Can I ask what OS and what window manager (with version) you are running?
xubuntu 18.10 I believe, WM & version - unsure offhand, xfce? Sorry, I'm quite new to the world of WMs and such!
Right sorry, xfce 4.12 / xfwm4 v4.12.5 rev d730ebb6 Compiled against GTK+-2.24.32, using GTK+-2.24.32. Padding & spacings are definitely all 0 in the pygrid config. Appreciate any ideas you might have!