From bc4375ca2ac08167f5e2ae626efac4934d4cd4ce Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Sat, 28 Oct 2006 02:01:19 +0000 Subject: [PATCH] These I'm also sure should be globalShortcuts(). Last up are the client actions. svn path=/trunk/KDE/kdebase/workspace/; revision=599655 --- useractions.cpp | 22 +++++++-------- workspace.cpp | 74 +++++-------------------------------------------- 2 files changed, 18 insertions(+), 78 deletions(-) diff --git a/useractions.cpp b/useractions.cpp index 3d7273078a..1d5490a20e 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -61,30 +61,30 @@ QMenu* Workspace::clientPopup() mKeepAboveOpAction = advanced_popup->addAction( i18n("Keep &Above Others") ); mKeepAboveOpAction->setIcon( SmallIconSet( "up" ) ); - mKeepAboveOpAction->setShortcut( keys->action("Window Above Other Windows")->shortcut() ); + mKeepAboveOpAction->setShortcut( keys->action("Window Above Other Windows")->globalShortcut() ); mKeepAboveOpAction->setCheckable( true ); mKeepAboveOpAction->setData( Options::KeepAboveOp ); mKeepBelowOpAction = advanced_popup->addAction( i18n("Keep &Below Others") ); mKeepBelowOpAction->setIcon( SmallIconSet( "down" ) ); - mKeepBelowOpAction->setShortcut( keys->action("Window Below Other Windows")->shortcut() ); + mKeepBelowOpAction->setShortcut( keys->action("Window Below Other Windows")->globalShortcut() ); mKeepBelowOpAction->setCheckable( true ); mKeepBelowOpAction->setData( Options::KeepBelowOp ); mFullScreenOpAction = advanced_popup->addAction( i18n("&Fullscreen") ); mFullScreenOpAction->setIcon( SmallIconSet( "window_fullscreen" ) ); - mFullScreenOpAction->setShortcut( keys->action("Window Fullscreen")->shortcut() ); + mFullScreenOpAction->setShortcut( keys->action("Window Fullscreen")->globalShortcut() ); mFullScreenOpAction->setCheckable( true ); mFullScreenOpAction->setData( Options::FullScreenOp ); mNoBorderOpAction = advanced_popup->addAction( i18n("&No Border") ); - mNoBorderOpAction->setShortcut( keys->action("Window No Border")->shortcut() ); + mNoBorderOpAction->setShortcut( keys->action("Window No Border")->globalShortcut() ); mNoBorderOpAction->setCheckable( true ); mNoBorderOpAction->setData( Options::NoBorderOp ); QAction *action = advanced_popup->addAction( i18n("Window &Shortcut...") ); action->setIcon( SmallIconSet("key_bindings") ); - action->setShortcut( keys->action("Setup Window Shortcut")->shortcut() ); + action->setShortcut( keys->action("Setup Window Shortcut")->globalShortcut() ); action->setData( Options::SetupWindowShortcutOp ); action = advanced_popup->addAction( i18n("&Special Window Settings...") ); @@ -123,24 +123,24 @@ QMenu* Workspace::clientPopup() mMoveOpAction = popup->addAction( i18n("&Move") ); mMoveOpAction->setIcon( SmallIconSet( "move" ) ); - mMoveOpAction->setShortcut( keys->action("Window Move")->shortcut() ); + mMoveOpAction->setShortcut( keys->action("Window Move")->globalShortcut() ); mMoveOpAction->setData( Options::MoveOp ); mResizeOpAction = popup->addAction( i18n("Re&size") ); - mResizeOpAction->setShortcut( keys->action("Window Resize")->shortcut() ); + mResizeOpAction->setShortcut( keys->action("Window Resize")->globalShortcut() ); mResizeOpAction->setData( Options::ResizeOp ); mMinimizeOpAction = popup->addAction( i18n("Mi&nimize") ); - mMinimizeOpAction->setShortcut( keys->action("Window Minimize")->shortcut() ); + mMinimizeOpAction->setShortcut( keys->action("Window Minimize")->globalShortcut() ); mMinimizeOpAction->setData( Options::MinimizeOp ); mMaximizeOpAction = popup->addAction( i18n("Ma&ximize") ); - mMaximizeOpAction->setShortcut( keys->action("Window Maximize")->shortcut() ); + mMaximizeOpAction->setShortcut( keys->action("Window Maximize")->globalShortcut() ); mMaximizeOpAction->setCheckable( true ); mMaximizeOpAction->setData( Options::MaximizeOp ); mShadeOpAction = popup->addAction( i18n("Sh&ade") ); - mShadeOpAction->setShortcut( keys->action("Window Shade")->shortcut() ); + mShadeOpAction->setShortcut( keys->action("Window Shade")->globalShortcut() ); mShadeOpAction->setCheckable( true ); mShadeOpAction->setData( Options::ShadeOp ); @@ -157,7 +157,7 @@ QMenu* Workspace::clientPopup() mCloseOpAction = popup->addAction( i18n("&Close") ); mCloseOpAction->setIcon( SmallIconSet( "fileclose" ) ); - mCloseOpAction->setShortcut( keys->action("Window Close")->shortcut() ); + mCloseOpAction->setShortcut( keys->action("Window Close")->globalShortcut() ); mCloseOpAction->setData( Options::CloseOp ); } return popup; diff --git a/workspace.cpp b/workspace.cpp index e404b7ddd3..da66f04068 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -42,9 +42,6 @@ License. See the file "COPYING" for the exact licensing terms. #include "group.h" #include "rules.h" #include "kwinadaptor.h" -#include "unmanaged.h" -#include "scene.h" -#include "effects.h" #include #include @@ -125,8 +122,7 @@ Workspace::Workspace( bool restore ) topmenu_space( NULL ), set_active_client_recursion( 0 ), block_stacking_updates( 0 ), - forced_global_mouse_grab( false ), - damage_region( None ) + forced_global_mouse_grab( false ) { new KWinAdaptor( "org.kde.kwin", "/KWin", QDBusConnection::sessionBus(), this ); @@ -170,12 +166,10 @@ Workspace::Workspace( bool restore ) ColormapChangeMask | SubstructureRedirectMask | SubstructureNotifyMask | - FocusChangeMask | // for NotifyDetailNone - ExposureMask + FocusChangeMask // for NotifyDetailNone ); - Extensions::init(); - setupCompositing(); + Shape::init(); // compatibility long data = 1; @@ -324,7 +318,6 @@ void Workspace::init() connect(&reconfigureTimer, SIGNAL(timeout()), this, SLOT(slotReconfigure())); connect( &updateToolWindowsTimer, SIGNAL( timeout()), this, SLOT( slotUpdateToolWindows())); - connect( &compositeTimer, SIGNAL( timeout()), SLOT( compositeTimeout())); connect(KGlobalSettings::self(), SIGNAL(appearanceChanged()), this, SLOT(slotReconfigure())); @@ -362,11 +355,7 @@ void Workspace::init() XWindowAttributes attr; XGetWindowAttributes(display(), wins[i], &attr); if (attr.override_redirect ) - { - if( attr.map_state != IsUnmapped && attr.c_class != InputOnly && compositing()) - createUnmanaged( wins[ i ] ); continue; - } if( topmenu_space && topmenu_space->winId() == wins[ i ] ) continue; if (attr.map_state != IsUnmapped) @@ -429,7 +418,6 @@ void Workspace::init() Workspace::~Workspace() { - finishCompositing(); blockStackingUpdates( true ); // TODO grabXServer(); // use stacking_order, so that kwin --replace keeps stacking order @@ -441,10 +429,6 @@ Workspace::~Workspace() (*it)->releaseWindow( true ); // no removeClient() is called ! } - for( UnmanagedList::ConstIterator it = unmanaged.begin(); - it != unmanaged.end(); - ++it ) - (*it)->release(); delete desktop_widget; delete tab_box; delete popupinfo; @@ -488,26 +472,6 @@ Client* Workspace::createClient( Window w, bool is_mapped ) return NULL; } addClient( c, Allowed ); - if( scene ) - scene->windowAdded( c ); - if( effects ) - effects->windowAdded( c ); - return c; - } - -Unmanaged* Workspace::createUnmanaged( Window w ) - { - Unmanaged* c = new Unmanaged( this ); - if( !c->track( w )) - { - Unmanaged::deleteUnmanaged( c, Allowed ); - return NULL; - } - addUnmanaged( c, Allowed ); - if( scene ) - scene->windowAdded( c ); - if( effects ) - effects->windowAdded( c ); return c; } @@ -550,11 +514,6 @@ void Workspace::addClient( Client* c, allowed_t ) updateToolWindows( true ); } -void Workspace::addUnmanaged( Unmanaged* c, allowed_t ) - { - unmanaged.append( c ); - } - /* Destroys the client \a c */ @@ -574,10 +533,6 @@ void Workspace::removeClient( Client* c, allowed_t ) Notify::raise( Notify::Delete ); Q_ASSERT( clients.contains( c ) || desktops.contains( c )); - if( scene ) - scene->windowDeleted( c ); - if( effects ) - effects->windowDeleted( c ); clients.removeAll( c ); desktops.removeAll( c ); unconstrained_stacking_order.removeAll( c ); @@ -613,16 +568,6 @@ void Workspace::removeClient( Client* c, allowed_t ) updateClientArea(); } -void Workspace::removeUnmanaged( Unmanaged* c, allowed_t ) - { - assert( unmanaged.contains( c )); - if( scene ) - scene->windowDeleted( c ); - if( effects ) - effects->windowDeleted( c ); - unmanaged.removeAll( c ); - } - void Workspace::updateFocusChains( Client* c, FocusChainChange change ) { if( !c->wantsTabFocus()) // doesn't want tab focus, remove @@ -919,7 +864,7 @@ void Workspace::slotSettingsChanged(int category) /*! Reread settings */ -KWIN_PROCEDURE( CheckBorderSizesProcedure, Client, cl->checkBorderSizes() ); +KWIN_PROCEDURE( CheckBorderSizesProcedure, cl->checkBorderSizes() ); void Workspace::slotReconfigure() { @@ -976,11 +921,6 @@ void Workspace::slotReconfigure() updateTopMenuGeometry(); updateCurrentTopMenu(); } - - if( options->useTranslucency ) - setupCompositing(); - else - finishCompositing(); loadWindowRules(); for( ClientList::Iterator it = clients.begin(); @@ -1682,7 +1622,7 @@ void Workspace::slotGrabWindow() QPixmap snapshot = QPixmap::grabWindow( active_client->frameId() ); //No XShape - no work. - if( Extensions::shapeAvailable()) + if( Shape::available()) { //As the first step, get the mask from XShape. int count, order; @@ -2395,7 +2335,7 @@ void Workspace::helperDialog( const QString& message, const Client* c ) { KAction* action = keys->action( "Window Operations Menu" ); QString shortcut = QString( "%1 (%2)" ).arg( action->text() ) - .arg( action->shortcut().seq( 0 ).toString()); + .arg( action->globalShortcut().seq( 0 ).toString()); args << "--msgbox" << i18n( "You have selected to show a window without its border.\n" "Without the border, you will not be able to enable the border " @@ -2408,7 +2348,7 @@ void Workspace::helperDialog( const QString& message, const Client* c ) { KAction* action = keys->action( "Window Operations Menu" ); QString shortcut = QString( "%1 (%2)" ).arg( action->text() ) - .arg( action->shortcut().seq( 0 ).toString()); + .arg( action->globalShortcut().seq( 0 ).toString()); args << "--msgbox" << i18n( "You have selected to show a window in fullscreen mode.\n" "If the application itself does not have an option to turn the fullscreen "