duncs / clusterssh

Cluster SSH - Cluster Admin Via SSH
https://github.com/duncs/clusterssh/wiki
896 stars 79 forks source link

Fixing WM Decorations for Gnome #86

Open fastcat opened 7 years ago

fastcat commented 7 years ago

The current WM decoration system just doesn't seem to be workable for gnome shell, without lots of manual hacking of pixel values specific to the layout of a particular set of terminals.

Having poked at it, the math needed for gnome shell is:

duncs commented 7 years ago

Thanks for the suggestions - I will investigate and hopefully fix for the next version

jagibson commented 3 years ago

Related - cssh doesn't seem to account for the toolbar on the left-hand side. I have my toolbar set to "always visible" but it seems that when cssh does the positioning calculation it assumes it can start all the way on the left hand side. Gnome then "pushes" the first window over to the right to make room for the toolbar resulting the first terminal overlapping the second. The rest of the console windows render in the correct spots. 2021-07-13_12-47 This is using Gnome 3.38.5 on Wayland (Ubuntu 21.04)

fastcat commented 3 years ago

@jagibson I think that's what screen_reserve_left is for? I don't know if the NetWM spec, or whatever its equivalent is these days, provides an API for tools like this to query those kinds of bordering things, but pretty sure you can work around it with that setting. IIRC I had to do that for the gnome top bar as well (I don't use this tool any more).

antofthy commented 3 years ago

It does actually... Also for the bottom or top bars too. From my personal notes on X window properties... https://antofthy.gitlab.io/info/X/Properity.txt

X window properities... _NET_WORKAREA returns X,Y, WIDTH, HEIGHT, repeated for each desktop. The screen area minus the reserved 'margins' set by the window manager, repeated for each of the desktops. Clients that maximise windows should only use this area. On my display whcih has a side, and bottom panels, and 4 desktops...

# xprop -root _NET_WORKAREA
_NET_WORKAREA(CARDINAL) = 60, 0, 3780, 1052, 60, 0, 3780, 1052, 60, 0, 3780, 1052, 60, 0, 3780, 1052

so I have 60 pixels reserved on left and a reduction in screen height from 1080 (full size) to 1052 (or 28 pixels at bottom)

There is also reporting on size of decorations on individual windows. _NET_FRAME_EXTENTS

In my ".clusterssh/config" I have...

screen_reserve_left=80
#screen_reserve_right=100
screen_reserve_top=20
screen_reserve_bottom=32
screen_reserve_right=2000

I keep some 'extra' space at top, and push everything to first monitor with extra space on right for some system monitors (outside the WM) So I would not be doing this automatically, BUT I could re-configure cssh if I wanted to!

Would have been nice if I could simply specify a maximum width (in case my second monitor disappears), rather than reserve_right. But then I could also set up something to reconfigure automatically if I wanted!

jagibson commented 3 years ago

@antofthy Thanks that did it. Things still get a little wonky when they span on to my second monitor but I set "screen_reserve_right" to prevent that from happening. Only downside is if I unplug my monitors (I have a laptop) that screen_reserve_right is really going to cram things.