the return of the popup_client, at least a tiny little bit :-) See

discussion on kwin@mail.kde.org

svn path=/trunk/kdebase/kwin/; revision=175528
This commit is contained in:
Matthias Ettrich 2002-09-03 16:05:30 +00:00
parent 8cf0fe3a91
commit e3dddfb21d
2 changed files with 30 additions and 35 deletions

View file

@ -112,8 +112,7 @@ public:
movingClient(0), movingClient(0),
layoutOrientation(Qt::Vertical), layoutOrientation(Qt::Vertical),
layoutX(-1), layoutX(-1),
layoutY(2), layoutY(2)
popup_client(NULL)
{ }; { };
~WorkspacePrivate() {}; ~WorkspacePrivate() {};
KStartupInfo* startup; KStartupInfo* startup;
@ -135,7 +134,6 @@ public:
int layoutX; int layoutX;
int layoutY; int layoutY;
Placement *initPositioning; Placement *initPositioning;
Client* popup_client;
}; };
}; };
@ -798,8 +796,8 @@ bool Workspace::destroyClient( Client* c)
if (c == active_client && popup) if (c == active_client && popup)
popup->close(); popup->close();
if( c == d->popup_client ) if( c == popup_client )
d->popup_client = NULL; popup_client = 0;
storeFakeSessionInfo( c ); storeFakeSessionInfo( c );
@ -1413,9 +1411,10 @@ void Workspace::setActiveClient( Client* c )
{ {
if ( active_client == c ) if ( active_client == c )
return; return;
if( popup && d->popup_client != c ) if( popup && popup_client != c ) {
popup->close(); popup->close();
d->popup_client = NULL; popup_client = 0;
}
if ( active_client ) { if ( active_client ) {
active_client->setActive( FALSE ); active_client->setActive( FALSE );
if ( active_client->isFullScreen() && active_client->staysOnTop() if ( active_client->isFullScreen() && active_client->staysOnTop()
@ -1782,7 +1781,7 @@ void Workspace::performWindowOperation( Client* c, Options::WindowOperation op )
void Workspace::clientPopupActivated( int id ) void Workspace::clientPopupActivated( int id )
{ {
performWindowOperation( active_client, (Options::WindowOperation) id ); performWindowOperation( popup_client ? popup_client : active_client, (Options::WindowOperation) id );
} }
/*! /*!
@ -2150,7 +2149,7 @@ void Workspace::focusToNull(){
} }
XSetInputFocus(qt_xdisplay(), null_focus_window, RevertToPointerRoot, qt_x_time ); XSetInputFocus(qt_xdisplay(), null_focus_window, RevertToPointerRoot, qt_x_time );
if( !block_focus ) if( !block_focus )
setActiveClient( NULL ); setActiveClient( 0 );
} }
@ -2183,12 +2182,12 @@ private:
static unsigned int max_cache_size; static unsigned int max_cache_size;
}; };
QValueList<Window>* ObscuringWindows::cached = NULL; QValueList<Window>* ObscuringWindows::cached = 0;
unsigned int ObscuringWindows::max_cache_size = 0; unsigned int ObscuringWindows::max_cache_size = 0;
void ObscuringWindows::create( Client* c ) void ObscuringWindows::create( Client* c )
{ {
if( cached == NULL ) if( cached == 0 )
cached = new QValueList<Window>; cached = new QValueList<Window>;
Window obs_win; Window obs_win;
XWindowChanges chngs; XWindowChanges chngs;
@ -2954,7 +2953,7 @@ void Workspace::desktopPopupAboutToShow()
*/ */
void Workspace::clientPopupAboutToShow() void Workspace::clientPopupAboutToShow()
{ {
if ( !active_client || !popup ) if ( !popup_client || !popup )
return; return;
if ( numberOfDesktops() == 1 ) if ( numberOfDesktops() == 1 )
@ -2967,16 +2966,16 @@ void Workspace::clientPopupAboutToShow()
initDesktopPopup(); initDesktopPopup();
} }
popup->setItemEnabled( Options::ResizeOp, active_client->isResizable() ); popup->setItemEnabled( Options::ResizeOp, popup_client->isResizable() );
popup->setItemEnabled( Options::MoveOp, active_client->isMovable() ); popup->setItemEnabled( Options::MoveOp, popup_client->isMovable() );
popup->setItemEnabled( Options::MaximizeOp, active_client->isMaximizable() ); popup->setItemEnabled( Options::MaximizeOp, popup_client->isMaximizable() );
popup->setItemChecked( Options::MaximizeOp, active_client->isMaximized() ); popup->setItemChecked( Options::MaximizeOp, popup_client->isMaximized() );
popup->setItemChecked( Options::ShadeOp, active_client->isShade() ); popup->setItemChecked( Options::ShadeOp, popup_client->isShade() );
popup->setItemChecked( Options::StaysOnTopOp, active_client->staysOnTop() ); popup->setItemChecked( Options::StaysOnTopOp, popup_client->staysOnTop() );
popup->setItemEnabled( Options::IconifyOp, active_client->isMinimizable() ); popup->setItemEnabled( Options::IconifyOp, popup_client->isMinimizable() );
popup->setItemEnabled( Options::ToggleStoreSettingsOp, !active_client->isTransient() ); popup->setItemEnabled( Options::ToggleStoreSettingsOp, !popup_client->isTransient() );
popup->setItemChecked( Options::ToggleStoreSettingsOp, active_client->storeSettings() ); popup->setItemChecked( Options::ToggleStoreSettingsOp, popup_client->storeSettings() );
popup->setItemChecked( Options::CloseOp, active_client->isCloseable() ); popup->setItemChecked( Options::CloseOp, popup_client->isCloseable() );
} }
@ -3026,14 +3025,14 @@ void Workspace::sendClientToDesktop( Client* c, int desk )
*/ */
void Workspace::sendToDesktop( int desk ) void Workspace::sendToDesktop( int desk )
{ {
if ( !active_client ) if ( !popup_client )
return; return;
if ( desk == 0 ) { if ( desk == 0 ) {
active_client->setSticky( !active_client->isSticky() ); popup_client->setSticky( !popup_client->isSticky() );
return; return;
} }
sendClientToDesktop( active_client, desk ); sendClientToDesktop( popup_client, desk );
} }
@ -3057,16 +3056,13 @@ void Workspace::showWindowMenu( int x, int y, Client* cl )
|| cl->isDock() || cl->isDock()
|| cl->isTopMenu()) || cl->isTopMenu())
return; return;
if( cl != active_client ) { if( cl != active_client )
activateClient( cl ); activateClient( cl );
d->popup_client = cl; // don't close the popup when the client becomes active
} popup_client = cl;
QPopupMenu* p = clientPopup(); QPopupMenu* p = clientPopup();
// Client* c = active_client; p->exec( QPoint( x, y ) );
p->exec( QPoint( x, y )); popup_client = 0;
// if ( hasClient( c ) )
// requestFocus( c );
} }
/*! /*!

View file

@ -395,8 +395,7 @@ private:
int number_of_desktops; int number_of_desktops;
QMemArray<int> desktop_focus_chain; QMemArray<int> desktop_focus_chain;
// KDE4 remove me - unused Client* popup_client;
QGuardedPtr<Client> popup_client__;
void loadSessionInfo(); void loadSessionInfo();