Bug 214586

Summary: Title bar buttons of small windows disappear complety
Product: [Plasma] kwin Reporter: Christian Janoff <kdebugs>
Component: kdecorationsAssignee: Sandro Giessl <sgiessl>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: kwin-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: screenshot

Description Christian Janoff 2009-11-14 23:04:19 UTC
Version:            (using KDE 4.3.3)
OS:                Linux
Installed from:    Gentoo Packages

Reproduce this bug by resizing any window to the smallest possible size.

=> All title bar buttons will disappear completely.

(Side effect: The window cannot be moved anymore by dragging the title bar. You can use "ALT + left mouse button" though.)

Sometimes "unwanted" pop up windows (Firefox) have a rather small size and no buttons at all, so that one has to use the keyboard (CTRL-W) to close them.

I think at least the "menu" button (the one with the application icon) should remain on the title bar.
Comment 1 Thomas Lübking 2009-11-15 00:11:22 UTC
As the deco controls a minimum size and the titlebar layout:
which one do you use?
Comment 2 Christian Janoff 2009-11-15 00:30:00 UTC
Created attachment 38334 [details]
screenshot

My decoration is "Ozone". But I tested them all: Only the "B II" deco does it right.
Comment 3 Thomas Lübking 2009-11-15 00:59:56 UTC
you're right, it seems to be a problem in KCommonDecoration

I'm not experienced with it's layouting, but apparently not only ::minimumSize() lacks calls to ::buttonContainerWidth() but the button hiding seems to be intended.
Sandro?
Comment 4 Sandro Giessl 2009-11-15 11:28:32 UTC
The button hiding is intened - when the window size becomes too small, there 
really are only three options:
1. force a certain window minimum size,
2. limit the decoration _layout_ to some size greater than the actual windows 
size (buttons would shift beyond the window geometry. makes the decoration 
look broken),
3. hide buttons and spacers etc. in a smart way ensuring that nothing looks 
broken

Third option has been chosen. 3. also is actually the best way to preserve the 
title bar dragging, because by hiding certain buttons the drag handle region 
is enlarged.

"::buttonContainerWidth()" is not called because the metrics of buttons are 
determined using pixel size metric hints provided by the decoration.

You are right in that the following improvements should be done:

- The menu button should never be hidden, I guess

- Button spacers should be hidden as well (I believe this is not done ATM. I 
didn't test it)

- Dragging of "empty" titlebar should remain functional in any circumstance
Comment 5 Martin Flöser 2016-08-29 06:24:21 UTC
The decoration infrastructure in KWin 5 changed significantly. The class KCommonDecoration does no longer exist and this means this bug report can no longer be fixed.