From a0b6bdb956754f1dc11bda910bef3ac21482049c Mon Sep 17 00:00:00 2001 From: Matthias Ettrich Date: Fri, 13 Oct 2000 15:37:07 +0000 Subject: [PATCH] don't minimize dialog boxes that have a managed parent. Unify operation menu enabled settings with visible decorations. svn path=/trunk/kdebase/kwin/; revision=67486 --- client.cpp | 13 +++++++------ workspace.cpp | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/client.cpp b/client.cpp index 392f527af0..4e6d8501ce 100644 --- a/client.cpp +++ b/client.cpp @@ -623,12 +623,12 @@ bool Client::manage( bool isMapped, bool doNotShow, bool isInitial ) else if ( info->state() & NET::MaxHoriz ) maximize( Client::MaximizeHorizontal ); - if ( isMaximizable() && !isMaximized() + if ( isMaximizable() && !isMaximized() && ( width() >= area.width() || height() >= area.height() ) ) { // window is too large for the screen, maximize in the // directions necessary and generate a suitable restore // geometry. - QSize s = adjustedSize( QSize( width()*2/3, height()*2/3 ) ); + QSize s = adjustedSize( QSize( width()*2/3, height()*2/3 ) ); if ( width() >= area.width() && height() >= area.height() ) { maximize( Client::MaximizeFull ); geom_restore.setSize( s ); @@ -695,7 +695,7 @@ void Client::fetchName() if ( XGetTextProperty( qt_xdisplay(), win, &tp, XA_WM_NAME) != 0 && tp.value != NULL ) { if ( tp.encoding == XA_STRING ) s = QString::fromLocal8Bit( (const char*) tp.value ); - else if ( XmbTextPropertyToTextList( qt_xdisplay(), &tp, &text, &count) == Success && + else if ( XmbTextPropertyToTextList( qt_xdisplay(), &tp, &text, &count) == Success && text != NULL && count > 0 ) { s = QString::fromLocal8Bit( text[0] ); XFreeStringList( text ); @@ -972,10 +972,10 @@ bool Client::configureRequest( XConfigureRequestEvent& e ) QSize ns = sizeForWindowSize( QSize( nw, nh ) ); QRect area = workspace()->clientArea(); - if ( isMaximizable() && !isMaximized() + if ( isMaximizable() && !isMaximized() && ( ns.width() >= area.width() || ns.height() >= area.height() ) ) { // window is too large for the screen, maximize in the - // directions necessary + // directions necessary if ( ns.width() >= area.width() && ns.height() >= area.height() ) { maximize( Client::MaximizeFull ); } else if ( ns.width() >= area.width() ) { @@ -1224,7 +1224,8 @@ bool Client::isMaximizable() const */ bool Client::isMinimizable() const { - return wantsTabFocus(); + return ( !isTransient() || !workspace()->findClient( transientFor() ) ) + && wantsTabFocus(); } diff --git a/workspace.cpp b/workspace.cpp index 0447464bae..40da781698 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -440,7 +440,7 @@ bool Workspace::workspaceEvent( XEvent * e ) if ( c ) (void) c->windowEvent( e ); return TRUE; - } + } return ( e->xmap.event != e->xmap.window ); // hide wm typical event from Qt @@ -2291,7 +2291,7 @@ void Workspace::clientPopupAboutToShow() popup->setItemChecked( Options::MaximizeOp, popup_client->isMaximized() ); popup->setItemChecked( Options::ShadeOp, popup_client->isShade() ); popup->setItemChecked( Options::StaysOnTopOp, popup_client->staysOnTop() ); - popup->setItemEnabled( Options::IconifyOp, !popup_client->isTransient() ); + popup->setItemEnabled( Options::IconifyOp, popup_client->isMinimizable() ); }