clusterssh icon indicating copy to clipboard operation
clusterssh copied to clipboard

Fixing WM Decorations for Gnome

Open fastcat opened this issue 8 years ago • 5 comments

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:

  • Use the screen edge reservations (as is) to reserve the space around the edges for the top bar and anything else the user has
  • Use the terminal edge reservations and decoration sizes to figure out how much space is available for each terminal
    • Only reservations are being used for this right now
  • For gnome shell, the window position is the top left corner of the decoration, not of the content. The current system can't deal with this because the title bar height has to be put in as terminal_reserve_top due to neither terminal_decoration_height nor the auto detected frame dimensions being used during the calculation of available space per-terminal

fastcat avatar Apr 26 '17 20:04 fastcat

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

duncs avatar May 03 '17 18:05 duncs

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)

jagibson avatar Jul 13 '21 17:07 jagibson

@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).

fastcat avatar Jul 14 '21 22:07 fastcat

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!

antofthy avatar Jul 27 '21 02:07 antofthy

@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.

jagibson avatar Sep 02 '21 19:09 jagibson