x11pygrid icon indicating copy to clipboard operation
x11pygrid copied to clipboard

Need workaround to properly resize Gnome Apps

Open pkkid opened this issue 9 years ago • 11 comments

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.

pkkid avatar May 23 '16 01:05 pkkid

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.

pkkid avatar May 24 '16 02:05 pkkid

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.

pkkid avatar Aug 29 '18 13:08 pkkid

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??

SimonDedman avatar Mar 15 '19 15:03 SimonDedman

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.

pkkid avatar Mar 15 '19 16:03 pkkid

Interestingly, I just installed catfish from the Ubuntu repo and it is respecting zero spacing for me (Ubuntu 18.04).

pkkid avatar Mar 15 '19 16:03 pkkid

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!

SimonDedman avatar Mar 15 '19 17:03 SimonDedman

Still working for me on catfish 1.4.7.

Selection_037

pkkid avatar Mar 15 '19 17:03 pkkid

well.... shit. Guess I'll have another bash around at this when I'm back at my linux box this weekend. Cheers Michael

SimonDedman avatar Mar 15 '19 17:03 SimonDedman

Can I ask what OS and what window manager (with version) you are running?

pkkid avatar Mar 15 '19 18:03 pkkid

xubuntu 18.10 I believe, WM & version - unsure offhand, xfce? Sorry, I'm quite new to the world of WMs and such!

SimonDedman avatar Mar 15 '19 18:03 SimonDedman

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!

SimonDedman avatar Mar 17 '19 17:03 SimonDedman