Bug 147938 - Maximize button missing from QMainWindows that aren't the first displayed in the application
Summary: Maximize button missing from QMainWindows that aren't the first displayed in ...
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-17 01:10 UTC by Pete Zakel
Modified: 2007-07-19 22:26 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
picture showing missing maximize button (57.65 KB, image/png)
2007-07-17 01:15 UTC, Pete Zakel
Details
picture showing expected behavior (KDE 3.1.3) (27.06 KB, image/png)
2007-07-17 01:18 UTC, Pete Zakel
Details
xprop output for KDE 3.1.3 (30.96 KB, text/plain)
2007-07-17 22:51 UTC, Pete Zakel
Details
xprop output for KDE 3.5.6 (31.31 KB, text/plain)
2007-07-17 22:52 UTC, Pete Zakel
Details
code used to calculate max window size (3.81 KB, text/plain)
2007-07-17 23:05 UTC, Pete Zakel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pete Zakel 2007-07-17 01:10:18 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    Ubuntu Packages
OS:                Linux

Our application is based on Qt.  This occurs with both our Qt 4.1.4 based application version and our Qt 4.2.3 based application version.  Our application starts with a QMainWindow-derived console window, which always displays with a Maximize button.

When displaying on a system using KDE 3.1.3-6.10 Red Hat, windows that we bring up (all derived from QMainWindow) subsequent to the console window all have Maximize buttons.

However, when displaying to a system using KDE 3.3.1-3.14 Red Hat, or KDE 3.5.6 (on a Ubuntu system), there is no Maximize button on any subsequent windows, and the Maximize menu entry for the window frame menu is grayed out.

This is VERY annoying to our customers.

I am not aware of anything we are doing that would prevent the Maximize button from appearing, and Trolltech knows of nothing we are doing that would do that either.

If there is anything we can do to tell Kwin to add the Maximize button, please let us know.  Also, if you could fix Kwin to work properly, we would really appreciate it.
Comment 1 Pete Zakel 2007-07-17 01:15:55 UTC
Created attachment 21166 [details]
picture showing missing maximize button

This picture shows the missing maximize button on the window titled
"/etc/motd".
Comment 2 Pete Zakel 2007-07-17 01:18:48 UTC
Created attachment 21167 [details]
picture showing expected behavior (KDE 3.1.3)

This picture shows the Maximize button is there on the same window it is
missing on in the other picture.  This is the expected behavior that we get
with KDE 3.1.3-6.10 Red Hat, and that we don't see with KDE 3.3.1 or 3.5.6.
Comment 3 Pete Zakel 2007-07-17 01:20:50 UTC
In both attached pictures I am running the same version of our software, based on Qt 4.2.3, and running on a Solaris 8 system displaying to a VNC display running on a Linux system.
Comment 4 Lubos Lunak 2007-07-17 10:51:53 UTC
Please attach 'xprop' output for the window.
Comment 5 Pete Zakel 2007-07-17 22:51:05 UTC
Created attachment 21173 [details]
xprop output for KDE 3.1.3

xprop output for /etc/motd window displayed to KDE 3.1.3 desktop.
Comment 6 Pete Zakel 2007-07-17 22:52:22 UTC
Created attachment 21174 [details]
xprop output for KDE 3.5.6

xprop output for /etc/motd window displayed to KDE 3.5.6 desktop
Comment 7 Pete Zakel 2007-07-17 23:05:09 UTC
Created attachment 21175 [details]
code used to calculate max window size

This is the portion of code used in our QMainWindow derived class for
calculating the maximum window size.
Comment 8 Pete Zakel 2007-07-17 23:11:31 UTC
Note that although the code included says "max window size can be full size of display", the logic actually maxes to the desktop availableGeometry area to ensure we don't make the window so large that the desktop toolbar hides part of the window.
Comment 9 Pete Zakel 2007-07-17 23:27:55 UTC
xprop on the two desktops show that both desktops are 1024x768.

Using xmag on the windows, I find that on the KDE 3.1.3 window the window frame is 20 pixels high on the top, 6 pixels wide on the right and left and 6 pixels high on the bottom.  On the KDE 3.5.6 window, it's 23 pixels on top, and 4 pixels on the sides and bottom, so the max size calculation seems to be correct.
Comment 10 Lubos Lunak 2007-07-18 15:21:09 UTC
The area for maximizing windows is 1024x768, but the window requests smaller maximum size than that -> KWin will therefore not allow maximizing of the window. That is what you are doing to prevent the Maximize button from appearing. There is nothing in KWin to fix to work properly.

I admit the window in this very specific case could actually fit, since the difference is exactly the border size, but since that can change dynamically, I don't find it worth the effort to do something about it just because you're trying to be smarter than the window manager.

The fix for you is simple though - just drop the nonsensical maximum size, as there's no point in setting it (for example, what you say in comment #8 makes no sense, since maximum size has nothing to do with components of the desktop covering a window). If you for some reason need this for some broken window manager, I see in the code you have special cases for some window managers, so keep it just for those window managers (or alternatively opt out for window managers like KWin that can figure out the obvious on their own).
Comment 11 Pete Zakel 2007-07-19 20:37:32 UTC
So although the maximum size of the window is as large as KDE would make it if there were a Maximize button, the Maximize button is not put on the window?

That sounds like a bug to me.

At the very least, it would be nice to have an option for KDE to put the Maximize button on a window regardless.  Why is the window manager second-guessing the application?

In any case, since I have a workaround to the KDE bug, I'll just leave it with these parting comments.
Comment 12 Lubos Lunak 2007-07-19 22:26:16 UTC
As already explained in the reply to your private mail, there is no bug and there is no point in adding a button that doesn't work. Also, it is your application second-guessing the window manager, not the other way around.