bbidulock / icewm

A window manager designed for speed, usability, and consistency
Other
589 stars 100 forks source link

How can I prevent new windows from appearing under the taskbar #697

Closed vincele closed 1 year ago

vincele commented 1 year ago

I have been searching how I can do that. I.E. avoid new windows having their titlebar under the taskbar.

my taskbar is located at the top of screen, on top of other windows, I would like to restrict all windows to stay in the "screen minus the taskbar area". Is that possible?

I thought the following would do it...

#  Let the Dock layer limit the workspace (incompatible with GNOME Panel)
# LimitByDockLayer=0 # 0/1
LimitByDockLayer=1

Looks similar to:

gijsbers commented 1 year ago

The smart placement seems to work, right? Then how are the appearing-under windows placed?

The LimitByDockLayer=1 hasn't been updated for two decades. Hence it won't work.

vincele commented 1 year ago

I'm not sure what you want to say by "smart placement seems to work". I've not configured it out, it is still to its default on value.

#  Smart window placement with minimal overlap.
# SmartPlacement=1 # 0/1

I could be convinced that there's "minimal overlap", in what I'm seeing happen. But the small remaining overlap is exactly what I would like to avoid. The title bar is behind the toolbar.

I've reserched a bit, trying to reproduce with different apps, and it happens with xfe and its associated subapps (file editor), the other apps I tried seem to behave more consistently, they appear "smartly", and keep their last launch geometry.

So this may be specific to xfe... Still investigating.

BTW if LimitByDockLayer is non functional, it should be at least told in a comment in the default config file, or removed from there, or whatever, but not left as-is. I can propose a patch, if you say what is appropriate.

gijsbers commented 1 year ago

If an app doesn't specify a location when it starts, then smart placement will place it at a reasonable location. This seems to avoid overlap with the taskbar. If not, please report the app and your theme.

If only xfe is a problem, then you can fix its startup position in your winoptions like this:

xterm.special.geometry: +9+29

LimitByDockLayer is actually tested for when updating the work area. So it has some use. The work area is not enforced so much.

We may actually want to modernize this aspect of icewm's functionality one day. Especially if people keep bugging me, and provide reproducable scenario's in detail.

gijsbers commented 1 year ago

I now see how xfe messes up. It sets hard locations in its WM_NORMAL_HINTS property:

WM_NORMAL_HINTS(WM_SIZE_HINTS):
        user specified location: 0, 0
        program specified location: 0, 0
        user specified size: 800 by 600
        program specified size: 800 by 600
        window gravity: NorthWest

This is a bug in xfe. Hence I will ignore this for icewm.

gijsbers commented 1 year ago

Add this to winoptions to avoid the xfe bug once and for all:

xfe.ignorePositionHint: 1
vincele commented 1 year ago

Yeah, looks like this is a working fix for xfe, I had to also do the same for xfw & xfi, and will probably need a full batch of those, but OK, this is actually not a bug in icewm.

Thanks a lot for the help