Suspend updating of window-specific settings during shutdown,
so that KWin doesn't have to be killed as the first one during shutdown. svn path=/trunk/KDE/kdebase/workspace/; revision=645397icc-effect-5.14.5
parent
81fdcfd20b
commit
082c4e95e3
258
client.h
258
client.h
|
@ -28,7 +28,6 @@ License. See the file "COPYING" for the exact licensing terms.
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
#include "kdecoration.h"
|
#include "kdecoration.h"
|
||||||
#include "rules.h"
|
#include "rules.h"
|
||||||
#include "toplevel.h"
|
|
||||||
|
|
||||||
class QTimer;
|
class QTimer;
|
||||||
class KProcess;
|
class KProcess;
|
||||||
|
@ -39,18 +38,21 @@ namespace KWinInternal
|
||||||
|
|
||||||
class Workspace;
|
class Workspace;
|
||||||
class Client;
|
class Client;
|
||||||
|
class WinInfo;
|
||||||
class SessionInfo;
|
class SessionInfo;
|
||||||
class Bridge;
|
class Bridge;
|
||||||
|
|
||||||
class Client
|
class Client : public QObject, public KDecorationDefines
|
||||||
: public Toplevel
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Client( Workspace *ws );
|
Client( Workspace *ws );
|
||||||
|
Window window() const;
|
||||||
|
Window frameId() const;
|
||||||
Window wrapperId() const;
|
Window wrapperId() const;
|
||||||
Window decorationId() const;
|
Window decorationId() const;
|
||||||
|
|
||||||
|
Workspace* workspace() const;
|
||||||
const Client* transientFor() const;
|
const Client* transientFor() const;
|
||||||
Client* transientFor();
|
Client* transientFor();
|
||||||
bool isTransient() const;
|
bool isTransient() const;
|
||||||
|
@ -64,20 +66,25 @@ class Client
|
||||||
const Group* group() const;
|
const Group* group() const;
|
||||||
Group* group();
|
Group* group();
|
||||||
void checkGroup( Group* gr = NULL, bool force = false );
|
void checkGroup( Group* gr = NULL, bool force = false );
|
||||||
|
void changeClientLeaderGroup( Group* gr );
|
||||||
|
// prefer isXXX() instead
|
||||||
|
NET::WindowType windowType( bool direct = false, int supported_types = SUPPORTED_WINDOW_TYPES_MASK ) const;
|
||||||
const WindowRules* rules() const;
|
const WindowRules* rules() const;
|
||||||
void removeRule( Rules* r );
|
void removeRule( Rules* r );
|
||||||
void setupWindowRules( bool ignore_temporary );
|
void setupWindowRules( bool ignore_temporary );
|
||||||
void applyWindowRules();
|
void applyWindowRules();
|
||||||
|
void updateWindowRules();
|
||||||
|
|
||||||
// returns true for "special" windows and false for windows which are "normal"
|
QRect geometry() const;
|
||||||
// (normal=window which has a border, can be moved by the user, can be closed, etc.)
|
QSize size() const;
|
||||||
// true for Desktop, Dock, Splash, Override and TopMenu (and Toolbar??? - for now)
|
|
||||||
// false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO
|
|
||||||
bool isSpecialWindow() const;
|
|
||||||
bool hasNETSupport() const;
|
|
||||||
|
|
||||||
QSize minSize() const;
|
QSize minSize() const;
|
||||||
QSize maxSize() const;
|
QSize maxSize() const;
|
||||||
|
QPoint pos() const;
|
||||||
|
QRect rect() const;
|
||||||
|
int x() const;
|
||||||
|
int y() const;
|
||||||
|
int width() const;
|
||||||
|
int height() const;
|
||||||
QPoint clientPos() const; // inside of geometry()
|
QPoint clientPos() const; // inside of geometry()
|
||||||
QSize clientSize() const;
|
QSize clientSize() const;
|
||||||
|
|
||||||
|
@ -85,8 +92,8 @@ class Client
|
||||||
virtual bool eventFilter( QObject* o, QEvent* e );
|
virtual bool eventFilter( QObject* o, QEvent* e );
|
||||||
|
|
||||||
bool manage( Window w, bool isMapped );
|
bool manage( Window w, bool isMapped );
|
||||||
|
|
||||||
void releaseWindow( bool on_shutdown = false );
|
void releaseWindow( bool on_shutdown = false );
|
||||||
void destroyClient();
|
|
||||||
|
|
||||||
enum Sizemode // how to resize the window in order to obey constains (mainly aspect ratios)
|
enum Sizemode // how to resize the window in order to obey constains (mainly aspect ratios)
|
||||||
{
|
{
|
||||||
|
@ -104,8 +111,11 @@ class Client
|
||||||
bool isActive() const;
|
bool isActive() const;
|
||||||
void setActive( bool );
|
void setActive( bool );
|
||||||
|
|
||||||
virtual int desktop() const;
|
int desktop() const;
|
||||||
void setDesktop( int );
|
void setDesktop( int );
|
||||||
|
bool isOnDesktop( int d ) const;
|
||||||
|
bool isOnCurrentDesktop() const;
|
||||||
|
bool isOnAllDesktops() const;
|
||||||
void setOnAllDesktops( bool set );
|
void setOnAllDesktops( bool set );
|
||||||
|
|
||||||
// !isMinimized() && not hidden, i.e. normally visible on some virtual desktop
|
// !isMinimized() && not hidden, i.e. normally visible on some virtual desktop
|
||||||
|
@ -123,7 +133,6 @@ class Client
|
||||||
MaximizeMode maximizeMode() const;
|
MaximizeMode maximizeMode() const;
|
||||||
bool isMinimizable() const;
|
bool isMinimizable() const;
|
||||||
void setMaximize( bool vertically, bool horizontally );
|
void setMaximize( bool vertically, bool horizontally );
|
||||||
QRect iconGeometry() const;
|
|
||||||
|
|
||||||
void setFullScreen( bool set, bool user );
|
void setFullScreen( bool set, bool user );
|
||||||
bool isFullScreen() const;
|
bool isFullScreen() const;
|
||||||
|
@ -158,9 +167,24 @@ class Client
|
||||||
// auxiliary functions, depend on the windowType
|
// auxiliary functions, depend on the windowType
|
||||||
bool wantsTabFocus() const;
|
bool wantsTabFocus() const;
|
||||||
bool wantsInput() const;
|
bool wantsInput() const;
|
||||||
|
bool hasNETSupport() const;
|
||||||
|
bool isMovable() const;
|
||||||
|
bool isDesktop() const;
|
||||||
|
bool isDock() const;
|
||||||
|
bool isToolbar() const;
|
||||||
|
bool isTopMenu() const;
|
||||||
|
bool isMenu() const;
|
||||||
|
bool isNormalWindow() const; // normal as in 'NET::Normal or NET::Unknown non-transient'
|
||||||
|
bool isDialog() const;
|
||||||
|
bool isSplash() const;
|
||||||
|
bool isUtility() const;
|
||||||
|
// returns true for "special" windows and false for windows which are "normal"
|
||||||
|
// (normal=window which has a border, can be moved by the user, can be closed, etc.)
|
||||||
|
// true for Desktop, Dock, Splash, Override and TopMenu (and Toolbar??? - for now)
|
||||||
|
// false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO
|
||||||
|
bool isSpecialWindow() const;
|
||||||
|
|
||||||
bool isResizable() const;
|
bool isResizable() const;
|
||||||
bool isMovable() const;
|
|
||||||
bool isCloseable() const; // may be closed by the user (may have a close button)
|
bool isCloseable() const; // may be closed by the user (may have a close button)
|
||||||
|
|
||||||
void takeActivity( int flags, bool handled, allowed_t ); // takes ActivityFlags as arg (in utils.h)
|
void takeActivity( int flags, bool handled, allowed_t ); // takes ActivityFlags as arg (in utils.h)
|
||||||
|
@ -173,6 +197,8 @@ class Client
|
||||||
void updateDecoration( bool check_workspace_pos, bool force = false );
|
void updateDecoration( bool check_workspace_pos, bool force = false );
|
||||||
void checkBorderSizes();
|
void checkBorderSizes();
|
||||||
|
|
||||||
|
// shape extensions
|
||||||
|
bool shape() const;
|
||||||
void updateShape();
|
void updateShape();
|
||||||
|
|
||||||
void setGeometry( int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet );
|
void setGeometry( int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet );
|
||||||
|
@ -198,6 +224,15 @@ class Client
|
||||||
|
|
||||||
bool performMouseCommand( Options::MouseCommand, QPoint globalPos, bool handled = false );
|
bool performMouseCommand( Options::MouseCommand, QPoint globalPos, bool handled = false );
|
||||||
|
|
||||||
|
QByteArray windowRole() const;
|
||||||
|
QByteArray sessionId();
|
||||||
|
QByteArray resourceName() const;
|
||||||
|
QByteArray resourceClass() const;
|
||||||
|
QByteArray wmCommand();
|
||||||
|
QByteArray wmClientMachine( bool use_localhost ) const;
|
||||||
|
Window wmClientLeader() const;
|
||||||
|
pid_t pid() const;
|
||||||
|
|
||||||
QRect adjustedClientArea( const QRect& desktop, const QRect& area ) const;
|
QRect adjustedClientArea( const QRect& desktop, const QRect& area ) const;
|
||||||
|
|
||||||
Colormap colormap() const;
|
Colormap colormap() const;
|
||||||
|
@ -222,6 +257,12 @@ class Client
|
||||||
|
|
||||||
void gotPing( Time timestamp );
|
void gotPing( Time timestamp );
|
||||||
|
|
||||||
|
static QByteArray staticWindowRole(WId);
|
||||||
|
static QByteArray staticSessionId(WId);
|
||||||
|
static QByteArray staticWmCommand(WId);
|
||||||
|
static QByteArray staticWmClientMachine(WId);
|
||||||
|
static Window staticWmClientLeader(WId);
|
||||||
|
|
||||||
void checkWorkspacePosition();
|
void checkWorkspacePosition();
|
||||||
void updateUserTime( Time time = CurrentTime );
|
void updateUserTime( Time time = CurrentTime );
|
||||||
Time userTime() const;
|
Time userTime() const;
|
||||||
|
@ -231,8 +272,8 @@ class Client
|
||||||
// does 'delete c;'
|
// does 'delete c;'
|
||||||
static void deleteClient( Client* c, allowed_t );
|
static void deleteClient( Client* c, allowed_t );
|
||||||
|
|
||||||
|
static bool resourceMatch( const Client* c1, const Client* c2 );
|
||||||
static bool belongToSameApplication( const Client* c1, const Client* c2, bool active_hack = false );
|
static bool belongToSameApplication( const Client* c1, const Client* c2, bool active_hack = false );
|
||||||
static bool sameAppWindowRoleMatch( const Client* c1, const Client* c2, bool active_hack );
|
|
||||||
static void readIcons( Window win, QPixmap* icon, QPixmap* miniicon );
|
static void readIcons( Window win, QPixmap* icon, QPixmap* miniicon );
|
||||||
|
|
||||||
void minimize( bool avoid_animation = false );
|
void minimize( bool avoid_animation = false );
|
||||||
|
@ -244,18 +285,10 @@ class Client
|
||||||
void showContextHelp();
|
void showContextHelp();
|
||||||
void cancelShadeHover();
|
void cancelShadeHover();
|
||||||
void cancelAutoRaise();
|
void cancelAutoRaise();
|
||||||
|
void destroyClient();
|
||||||
void checkActiveModal();
|
void checkActiveModal();
|
||||||
bool hasStrut() const;
|
bool hasStrut() const;
|
||||||
|
|
||||||
bool isMove() const
|
|
||||||
{
|
|
||||||
return moveResizeMode && mode == PositionCenter;
|
|
||||||
}
|
|
||||||
bool isResize() const
|
|
||||||
{
|
|
||||||
return moveResizeMode && mode != PositionCenter;
|
|
||||||
}
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void autoRaise();
|
void autoRaise();
|
||||||
void shadeHover();
|
void shadeHover();
|
||||||
|
@ -273,6 +306,8 @@ class Client
|
||||||
void setCursor( Position m );
|
void setCursor( Position m );
|
||||||
void setCursor( const QCursor& c );
|
void setCursor( const QCursor& c );
|
||||||
|
|
||||||
|
void animateMinimizeOrUnminimize( bool minimize );
|
||||||
|
QPixmap animationPixmap( int w );
|
||||||
// transparent stuff
|
// transparent stuff
|
||||||
void drawbound( const QRect& geom );
|
void drawbound( const QRect& geom );
|
||||||
void clearbound();
|
void clearbound();
|
||||||
|
@ -283,11 +318,10 @@ class Client
|
||||||
void unmapNotifyEvent( XUnmapEvent*e );
|
void unmapNotifyEvent( XUnmapEvent*e );
|
||||||
void destroyNotifyEvent( XDestroyWindowEvent*e );
|
void destroyNotifyEvent( XDestroyWindowEvent*e );
|
||||||
void configureRequestEvent( XConfigureRequestEvent* e );
|
void configureRequestEvent( XConfigureRequestEvent* e );
|
||||||
virtual void propertyNotifyEvent( XPropertyEvent* e );
|
void propertyNotifyEvent( XPropertyEvent* e );
|
||||||
void clientMessageEvent( XClientMessageEvent* e );
|
void clientMessageEvent( XClientMessageEvent* e );
|
||||||
void enterNotifyEvent( XCrossingEvent* e );
|
void enterNotifyEvent( XCrossingEvent* e );
|
||||||
void leaveNotifyEvent( XCrossingEvent* e );
|
void leaveNotifyEvent( XCrossingEvent* e );
|
||||||
void visibilityNotifyEvent( XVisibilityEvent* e );
|
|
||||||
void focusInEvent( XFocusInEvent* e );
|
void focusInEvent( XFocusInEvent* e );
|
||||||
void focusOutEvent( XFocusOutEvent* e );
|
void focusOutEvent( XFocusOutEvent* e );
|
||||||
|
|
||||||
|
@ -297,9 +331,6 @@ class Client
|
||||||
|
|
||||||
void processDecorationButtonPress( int button, int state, int x, int y, int x_root, int y_root );
|
void processDecorationButtonPress( int button, int state, int x, int y, int x_root, int y_root );
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void debug( kdbgstream& stream ) const;
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void pingTimeout();
|
void pingTimeout();
|
||||||
void processKillerExited();
|
void processKillerExited();
|
||||||
|
@ -321,12 +352,13 @@ class Client
|
||||||
void getWmNormalHints();
|
void getWmNormalHints();
|
||||||
void getMotifHints();
|
void getMotifHints();
|
||||||
void getIcons();
|
void getIcons();
|
||||||
|
void getWmClientLeader();
|
||||||
|
void getWmClientMachine();
|
||||||
void fetchName();
|
void fetchName();
|
||||||
void fetchIconicName();
|
void fetchIconicName();
|
||||||
QString readName() const;
|
QString readName() const;
|
||||||
void setCaption( const QString& s, bool force = false );
|
void setCaption( const QString& s, bool force = false );
|
||||||
bool hasTransientInternal( const Client* c, bool indirect, ConstClientList& set ) const;
|
bool hasTransientInternal( const Client* c, bool indirect, ConstClientList& set ) const;
|
||||||
void updateWindowRules();
|
|
||||||
void finishWindowRules();
|
void finishWindowRules();
|
||||||
void setShortcutInternal( const KShortcut& cut );
|
void setShortcutInternal( const KShortcut& cut );
|
||||||
|
|
||||||
|
@ -336,7 +368,7 @@ class Client
|
||||||
void configureRequest( int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool );
|
void configureRequest( int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool );
|
||||||
NETExtendedStrut strut() const;
|
NETExtendedStrut strut() const;
|
||||||
int checkShadeGeometry( int w, int h );
|
int checkShadeGeometry( int w, int h );
|
||||||
void blockGeometryUpdates( bool block );
|
void postponeGeometryUpdates( bool postpone );
|
||||||
|
|
||||||
bool startMoveResize();
|
bool startMoveResize();
|
||||||
void finishMoveResize( bool cancel );
|
void finishMoveResize( bool cancel );
|
||||||
|
@ -366,11 +398,14 @@ class Client
|
||||||
Time readUserTimeMapTimestamp( const KStartupInfoId* asn_id, const KStartupInfoData* asn_data,
|
Time readUserTimeMapTimestamp( const KStartupInfoId* asn_id, const KStartupInfoData* asn_data,
|
||||||
bool session ) const;
|
bool session ) const;
|
||||||
Time readUserCreationTime() const;
|
Time readUserCreationTime() const;
|
||||||
|
static bool sameAppWindowRoleMatch( const Client* c1, const Client* c2, bool active_hack );
|
||||||
void startupIdChanged();
|
void startupIdChanged();
|
||||||
|
|
||||||
Window client;
|
Window client;
|
||||||
Window wrapper;
|
Window wrapper;
|
||||||
|
Window frame;
|
||||||
KDecoration* decoration;
|
KDecoration* decoration;
|
||||||
|
Workspace* wspace;
|
||||||
Bridge* bridge;
|
Bridge* bridge;
|
||||||
int desk;
|
int desk;
|
||||||
bool buttonDown;
|
bool buttonDown;
|
||||||
|
@ -378,6 +413,14 @@ class Client
|
||||||
bool move_faked_activity;
|
bool move_faked_activity;
|
||||||
Window move_resize_grab_window;
|
Window move_resize_grab_window;
|
||||||
bool unrestrictedMoveResize;
|
bool unrestrictedMoveResize;
|
||||||
|
bool isMove() const
|
||||||
|
{
|
||||||
|
return moveResizeMode && mode == PositionCenter;
|
||||||
|
}
|
||||||
|
bool isResize() const
|
||||||
|
{
|
||||||
|
return moveResizeMode && mode != PositionCenter;
|
||||||
|
}
|
||||||
|
|
||||||
Position mode;
|
Position mode;
|
||||||
QPoint moveOffset;
|
QPoint moveOffset;
|
||||||
|
@ -403,6 +446,7 @@ class Client
|
||||||
uint active :1;
|
uint active :1;
|
||||||
uint deleting : 1; // true when doing cleanup and destroying the client
|
uint deleting : 1; // true when doing cleanup and destroying the client
|
||||||
uint keep_above : 1; // NET::KeepAbove (was stays_on_top)
|
uint keep_above : 1; // NET::KeepAbove (was stays_on_top)
|
||||||
|
uint is_shape :1;
|
||||||
uint skip_taskbar :1;
|
uint skip_taskbar :1;
|
||||||
uint original_skip_taskbar :1; // unaffected by KWin
|
uint original_skip_taskbar :1; // unaffected by KWin
|
||||||
uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol?
|
uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol?
|
||||||
|
@ -422,7 +466,6 @@ class Client
|
||||||
uint modal : 1; // NET::Modal
|
uint modal : 1; // NET::Modal
|
||||||
uint noborder : 1;
|
uint noborder : 1;
|
||||||
uint user_noborder : 1;
|
uint user_noborder : 1;
|
||||||
uint not_obscured : 1;
|
|
||||||
uint urgency : 1; // XWMHints, UrgencyHint
|
uint urgency : 1; // XWMHints, UrgencyHint
|
||||||
uint ignore_focus_stealing : 1; // don't apply focus stealing prevention to this client
|
uint ignore_focus_stealing : 1; // don't apply focus stealing prevention to this client
|
||||||
uint demands_attention : 1;
|
uint demands_attention : 1;
|
||||||
|
@ -442,10 +485,16 @@ class Client
|
||||||
QRect geom_fs_restore;
|
QRect geom_fs_restore;
|
||||||
MaximizeMode maxmode_restore;
|
MaximizeMode maxmode_restore;
|
||||||
int workarea_diff_x, workarea_diff_y;
|
int workarea_diff_x, workarea_diff_y;
|
||||||
|
WinInfo* info;
|
||||||
QTimer* autoRaiseTimer;
|
QTimer* autoRaiseTimer;
|
||||||
QTimer* shadeHoverTimer;
|
QTimer* shadeHoverTimer;
|
||||||
Colormap cmap;
|
Colormap cmap;
|
||||||
|
QByteArray resource_name;
|
||||||
|
QByteArray resource_class;
|
||||||
|
QByteArray client_machine;
|
||||||
QString cap_normal, cap_iconic, cap_suffix;
|
QString cap_normal, cap_iconic, cap_suffix;
|
||||||
|
WId wmClientLeaderWin;
|
||||||
|
QByteArray window_role;
|
||||||
Group* in_group;
|
Group* in_group;
|
||||||
Window window_group;
|
Window window_group;
|
||||||
Layer in_layer;
|
Layer in_layer;
|
||||||
|
@ -454,10 +503,10 @@ class Client
|
||||||
Time ping_timestamp;
|
Time ping_timestamp;
|
||||||
Time user_time;
|
Time user_time;
|
||||||
unsigned long allowed_actions;
|
unsigned long allowed_actions;
|
||||||
|
QRect frame_geometry;
|
||||||
QSize client_size;
|
QSize client_size;
|
||||||
int block_geometry_updates; // >0 - new geometry is remembered, but not actually set
|
int postpone_geometry_updates; // >0 - new geometry is remembered, but not actually set
|
||||||
bool pending_geometry_update;
|
bool pending_geometry_update;
|
||||||
QRect geom_before_block;
|
|
||||||
bool shade_geometry_change;
|
bool shade_geometry_change;
|
||||||
int border_left, border_right, border_top, border_bottom;
|
int border_left, border_right, border_top, border_bottom;
|
||||||
QRegion _mask;
|
QRegion _mask;
|
||||||
|
@ -467,20 +516,22 @@ class Client
|
||||||
friend struct FetchNameInternalPredicate;
|
friend struct FetchNameInternalPredicate;
|
||||||
friend struct CheckIgnoreFocusStealingProcedure;
|
friend struct CheckIgnoreFocusStealingProcedure;
|
||||||
friend struct ResetupRulesProcedure;
|
friend struct ResetupRulesProcedure;
|
||||||
friend class GeometryUpdatesBlocker;
|
friend class GeometryUpdatesPostponer;
|
||||||
void show() { assert( false ); } // SELI remove after Client is no longer QWidget
|
void show() { assert( false ); } // SELI remove after Client is no longer QWidget
|
||||||
void hide() { assert( false ); }
|
void hide() { assert( false ); }
|
||||||
QTimer* demandAttentionKNotifyTimer;
|
QTimer* demandAttentionKNotifyTimer;
|
||||||
|
|
||||||
|
friend bool performTransiencyCheck();
|
||||||
};
|
};
|
||||||
|
|
||||||
// helper for Client::blockGeometryUpdates() being called in pairs (true/false)
|
// helper for Client::postponeGeometryUpdates() being called in pairs (true/false)
|
||||||
class GeometryUpdatesBlocker
|
class GeometryUpdatesPostponer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GeometryUpdatesBlocker( Client* c )
|
GeometryUpdatesPostponer( Client* c )
|
||||||
: cl( c ) { cl->blockGeometryUpdates( true ); }
|
: cl( c ) { cl->postponeGeometryUpdates( true ); }
|
||||||
~GeometryUpdatesBlocker()
|
~GeometryUpdatesPostponer()
|
||||||
{ cl->blockGeometryUpdates( false ); }
|
{ cl->postponeGeometryUpdates( false ); }
|
||||||
private:
|
private:
|
||||||
Client* cl;
|
Client* cl;
|
||||||
};
|
};
|
||||||
|
@ -496,11 +547,20 @@ class WinInfo : public NETWinInfo
|
||||||
Window rwin, const unsigned long pr[], int pr_size );
|
Window rwin, const unsigned long pr[], int pr_size );
|
||||||
virtual void changeDesktop(int desktop);
|
virtual void changeDesktop(int desktop);
|
||||||
virtual void changeState( unsigned long state, unsigned long mask );
|
virtual void changeState( unsigned long state, unsigned long mask );
|
||||||
void disable();
|
|
||||||
private:
|
private:
|
||||||
Client * m_client;
|
Client * m_client;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline Window Client::window() const
|
||||||
|
{
|
||||||
|
return client;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Window Client::frameId() const
|
||||||
|
{
|
||||||
|
return frame;
|
||||||
|
}
|
||||||
|
|
||||||
inline Window Client::wrapperId() const
|
inline Window Client::wrapperId() const
|
||||||
{
|
{
|
||||||
return wrapper;
|
return wrapper;
|
||||||
|
@ -511,6 +571,11 @@ inline Window Client::decorationId() const
|
||||||
return decoration != NULL ? decoration->widget()->winId() : None;
|
return decoration != NULL ? decoration->widget()->winId() : None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline Workspace* Client::workspace() const
|
||||||
|
{
|
||||||
|
return wspace;
|
||||||
|
}
|
||||||
|
|
||||||
inline const Client* Client::transientFor() const
|
inline const Client* Client::transientFor() const
|
||||||
{
|
{
|
||||||
return transient_for;
|
return transient_for;
|
||||||
|
@ -558,6 +623,16 @@ inline int Client::mappingState() const
|
||||||
return mapping_state;
|
return mapping_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline QByteArray Client::resourceName() const
|
||||||
|
{
|
||||||
|
return resource_name; // it is always lowercase
|
||||||
|
}
|
||||||
|
|
||||||
|
inline QByteArray Client::resourceClass() const
|
||||||
|
{
|
||||||
|
return resource_class; // it is always lowercase
|
||||||
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
bool Client::isMinimized() const
|
bool Client::isMinimized() const
|
||||||
{
|
{
|
||||||
|
@ -569,6 +644,30 @@ inline bool Client::isActive() const
|
||||||
return active;
|
return active;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the virtual desktop within the workspace() the client window
|
||||||
|
is located in, 0 if it isn't located on any special desktop (not mapped yet),
|
||||||
|
or NET::OnAllDesktops. Do not use desktop() directly, use
|
||||||
|
isOnDesktop() instead.
|
||||||
|
*/
|
||||||
|
inline int Client::desktop() const
|
||||||
|
{
|
||||||
|
return desk;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool Client::isOnAllDesktops() const
|
||||||
|
{
|
||||||
|
return desk == NET::OnAllDesktops;
|
||||||
|
}
|
||||||
|
/*!
|
||||||
|
Returns whether the client is on the virtual desktop \a d.
|
||||||
|
This is always true for onAllDesktops clients.
|
||||||
|
*/
|
||||||
|
inline bool Client::isOnDesktop( int d ) const
|
||||||
|
{
|
||||||
|
return desk == d || /*desk == 0 ||*/ isOnAllDesktops();
|
||||||
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
bool Client::isShown( bool shaded_is_shown ) const
|
bool Client::isShown( bool shaded_is_shown ) const
|
||||||
{
|
{
|
||||||
|
@ -632,6 +731,12 @@ inline bool Client::keepBelow() const
|
||||||
return keep_below;
|
return keep_below;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool Client::shape() const
|
||||||
|
{
|
||||||
|
return is_shape;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline bool Client::isFullScreen() const
|
inline bool Client::isFullScreen() const
|
||||||
{
|
{
|
||||||
return fullscreen_mode != FullScreenNone;
|
return fullscreen_mode != FullScreenNone;
|
||||||
|
@ -652,6 +757,11 @@ inline Colormap Client::colormap() const
|
||||||
return cmap;
|
return cmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline pid_t Client::pid() const
|
||||||
|
{
|
||||||
|
return info->pid();
|
||||||
|
}
|
||||||
|
|
||||||
inline void Client::invalidateLayer()
|
inline void Client::invalidateLayer()
|
||||||
{
|
{
|
||||||
in_layer = UnknownLayer;
|
in_layer = UnknownLayer;
|
||||||
|
@ -677,6 +787,51 @@ inline bool Client::isManaged() const
|
||||||
return mapping_state != WithdrawnState;
|
return mapping_state != WithdrawnState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline QByteArray Client::windowRole() const
|
||||||
|
{
|
||||||
|
return window_role;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline QRect Client::geometry() const
|
||||||
|
{
|
||||||
|
return frame_geometry;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline QSize Client::size() const
|
||||||
|
{
|
||||||
|
return frame_geometry.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline QPoint Client::pos() const
|
||||||
|
{
|
||||||
|
return frame_geometry.topLeft();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline int Client::x() const
|
||||||
|
{
|
||||||
|
return frame_geometry.x();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline int Client::y() const
|
||||||
|
{
|
||||||
|
return frame_geometry.y();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline int Client::width() const
|
||||||
|
{
|
||||||
|
return frame_geometry.width();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline int Client::height() const
|
||||||
|
{
|
||||||
|
return frame_geometry.height();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline QRect Client::rect() const
|
||||||
|
{
|
||||||
|
return QRect( 0, 0, width(), height());
|
||||||
|
}
|
||||||
|
|
||||||
inline QPoint Client::clientPos() const
|
inline QPoint Client::clientPos() const
|
||||||
{
|
{
|
||||||
return QPoint( border_left, border_top );
|
return QPoint( border_left, border_top );
|
||||||
|
@ -722,7 +877,7 @@ inline const WindowRules* Client::rules() const
|
||||||
return &client_rules;
|
return &client_rules;
|
||||||
}
|
}
|
||||||
|
|
||||||
KWIN_PROCEDURE( CheckIgnoreFocusStealingProcedure, Client, cl->ignore_focus_stealing = options->checkIgnoreFocusStealing( cl ));
|
KWIN_PROCEDURE( CheckIgnoreFocusStealingProcedure, cl->ignore_focus_stealing = options->checkIgnoreFocusStealing( cl ));
|
||||||
|
|
||||||
inline Window Client::moveResizeGrabWindow() const
|
inline Window Client::moveResizeGrabWindow() const
|
||||||
{
|
{
|
||||||
|
@ -739,7 +894,22 @@ inline void Client::removeRule( Rules* rule )
|
||||||
client_rules.remove( rule );
|
client_rules.remove( rule );
|
||||||
}
|
}
|
||||||
|
|
||||||
KWIN_COMPARE_PREDICATE( WrapperIdMatchPredicate, Client, Window, cl->wrapperId() == value );
|
#ifdef NDEBUG
|
||||||
|
inline
|
||||||
|
kndbgstream& operator<<( kndbgstream& stream, const Client* ) { return stream; }
|
||||||
|
inline
|
||||||
|
kndbgstream& operator<<( kndbgstream& stream, const ClientList& ) { return stream; }
|
||||||
|
inline
|
||||||
|
kndbgstream& operator<<( kndbgstream& stream, const ConstClientList& ) { return stream; }
|
||||||
|
#else
|
||||||
|
kdbgstream& operator<<( kdbgstream& stream, const Client* );
|
||||||
|
kdbgstream& operator<<( kdbgstream& stream, const ClientList& );
|
||||||
|
kdbgstream& operator<<( kdbgstream& stream, const ConstClientList& );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
KWIN_COMPARE_PREDICATE( WindowMatchPredicate, Window, cl->window() == value );
|
||||||
|
KWIN_COMPARE_PREDICATE( FrameIdMatchPredicate, Window, cl->frameId() == value );
|
||||||
|
KWIN_COMPARE_PREDICATE( WrapperIdMatchPredicate, Window, cl->wrapperId() == value );
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
10
rules.cpp
10
rules.cpp
|
@ -850,6 +850,8 @@ void Client::updateWindowRules()
|
||||||
{
|
{
|
||||||
if( !isManaged()) // not fully setup yet
|
if( !isManaged()) // not fully setup yet
|
||||||
return;
|
return;
|
||||||
|
if( workspace()->rulesUpdatesDisabled())
|
||||||
|
return;
|
||||||
client_rules.update( this );
|
client_rules.update( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1007,6 +1009,14 @@ void Workspace::rulesUpdated()
|
||||||
rulesUpdatedTimer.start( 1000 );
|
rulesUpdatedTimer.start( 1000 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Workspace::disableRulesUpdates( bool disable )
|
||||||
|
{
|
||||||
|
rules_updates_disabled = disable;
|
||||||
|
if( !disable )
|
||||||
|
foreach( Client* c, clients )
|
||||||
|
c->updateWindowRules();
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
37
sm.cpp
37
sm.cpp
|
@ -11,6 +11,7 @@ License. See the file "COPYING" for the exact licensing terms.
|
||||||
|
|
||||||
#include "sm.h"
|
#include "sm.h"
|
||||||
|
|
||||||
|
//#include <kdebug.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
@ -22,7 +23,6 @@ License. See the file "COPYING" for the exact licensing terms.
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include <QSocketNotifier>
|
#include <QSocketNotifier>
|
||||||
#include <qsessionmanager.h>
|
#include <qsessionmanager.h>
|
||||||
#include <kdebug.h>
|
|
||||||
|
|
||||||
namespace KWinInternal
|
namespace KWinInternal
|
||||||
{
|
{
|
||||||
|
@ -256,28 +256,6 @@ bool Workspace::sessionInfoWindowTypeMatch( Client* c, SessionInfo* info )
|
||||||
return info->windowType == c->windowType();
|
return info->windowType == c->windowType();
|
||||||
}
|
}
|
||||||
|
|
||||||
// maybe needed later
|
|
||||||
#if 0
|
|
||||||
// KMainWindow's without name() given have WM_WINDOW_ROLE in the form
|
|
||||||
// of <appname>-mainwindow#<number>
|
|
||||||
// when comparing them for fake session info, it's probably better to check
|
|
||||||
// them without the trailing number
|
|
||||||
bool Workspace::windowRoleMatch( const QByteArray& role1, const QByteArray& role2 )
|
|
||||||
{
|
|
||||||
if( role1.isEmpty() && role2.isEmpty())
|
|
||||||
return true;
|
|
||||||
int pos1 = role1.find( '#' );
|
|
||||||
int pos2 = role2.find( '#' );
|
|
||||||
bool ret;
|
|
||||||
if( pos1 < 0 || pos2 < 0 || pos1 != pos2 )
|
|
||||||
ret = role1 == role2;
|
|
||||||
else
|
|
||||||
ret = qstrncmp( role1, role2, pos1 ) == 0;
|
|
||||||
kDebug() << "WR:" << role1 << ":" << pos1 << ":" << role2 << ":" << pos2 << ":::" << ret << endl;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const char* const window_type_names[] =
|
static const char* const window_type_names[] =
|
||||||
{
|
{
|
||||||
"Unknown", "Normal" , "Desktop", "Dock", "Toolbar", "Menu", "Dialog",
|
"Unknown", "Normal" , "Desktop", "Dock", "Toolbar", "Menu", "Dialog",
|
||||||
|
@ -315,11 +293,21 @@ NET::WindowType Workspace::txtToWindowType( const char* txt )
|
||||||
// but Qt doesn't have API for saying when session saved finished (either
|
// but Qt doesn't have API for saying when session saved finished (either
|
||||||
// successfully, or was canceled). Therefore, create another connection
|
// successfully, or was canceled). Therefore, create another connection
|
||||||
// to session manager, that will provide this information.
|
// to session manager, that will provide this information.
|
||||||
static void save_yourself( SmcConn conn_P, SmPointer ptr, int, Bool, int, Bool )
|
// Similarly the remember feature of window-specific settings should be disabled
|
||||||
|
// during KDE shutdown when windows may move e.g. because of Kicker going away
|
||||||
|
// (struts changing). When session saving starts, it can be cancelled, in which
|
||||||
|
// case the shutdown_cancelled callback is invoked, or it's a checkpoint that
|
||||||
|
// is immediatelly followed by save_complete, or finally it's a shutdown that
|
||||||
|
// is immediatelly followed by die callback. So getting save_yourself with shutdown
|
||||||
|
// set disables window-specific settings remembering, getting shutdown_cancelled
|
||||||
|
// re-enables, otherwise KWin will go away after die.
|
||||||
|
static void save_yourself( SmcConn conn_P, SmPointer ptr, int, Bool shutdown, int, Bool )
|
||||||
{
|
{
|
||||||
SessionSaveDoneHelper* session = reinterpret_cast< SessionSaveDoneHelper* >( ptr );
|
SessionSaveDoneHelper* session = reinterpret_cast< SessionSaveDoneHelper* >( ptr );
|
||||||
if( conn_P != session->connection())
|
if( conn_P != session->connection())
|
||||||
return;
|
return;
|
||||||
|
if( shutdown )
|
||||||
|
Workspace::self()->disableRulesUpdates( true );
|
||||||
SmcSaveYourselfDone( conn_P, True );
|
SmcSaveYourselfDone( conn_P, True );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,6 +333,7 @@ static void shutdown_cancelled( SmcConn conn_P, SmPointer ptr )
|
||||||
SessionSaveDoneHelper* session = reinterpret_cast< SessionSaveDoneHelper* >( ptr );
|
SessionSaveDoneHelper* session = reinterpret_cast< SessionSaveDoneHelper* >( ptr );
|
||||||
if( conn_P != session->connection())
|
if( conn_P != session->connection())
|
||||||
return;
|
return;
|
||||||
|
Workspace::self()->disableRulesUpdates( false ); // re-enable
|
||||||
// no need to differentiate between successful finish and cancel
|
// no need to differentiate between successful finish and cancel
|
||||||
session->saveDone();
|
session->saveDone();
|
||||||
}
|
}
|
||||||
|
|
173
workspace.cpp
173
workspace.cpp
|
@ -43,10 +43,6 @@ License. See the file "COPYING" for the exact licensing terms.
|
||||||
#include "group.h"
|
#include "group.h"
|
||||||
#include "rules.h"
|
#include "rules.h"
|
||||||
#include "kwinadaptor.h"
|
#include "kwinadaptor.h"
|
||||||
#include "unmanaged.h"
|
|
||||||
#include "scene.h"
|
|
||||||
#include "deleted.h"
|
|
||||||
#include "effects.h"
|
|
||||||
|
|
||||||
#include <X11/extensions/shape.h>
|
#include <X11/extensions/shape.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
@ -80,6 +76,7 @@ Workspace::Workspace( bool restore )
|
||||||
active_popup_client( NULL ),
|
active_popup_client( NULL ),
|
||||||
desktop_widget (0),
|
desktop_widget (0),
|
||||||
temporaryRulesMessages( "_KDE_NET_WM_TEMPORARY_RULES", NULL, false ),
|
temporaryRulesMessages( "_KDE_NET_WM_TEMPORARY_RULES", NULL, false ),
|
||||||
|
rules_updates_disabled( false ),
|
||||||
active_client (0),
|
active_client (0),
|
||||||
last_active_client (0),
|
last_active_client (0),
|
||||||
most_recently_raised (0),
|
most_recently_raised (0),
|
||||||
|
@ -98,7 +95,6 @@ Workspace::Workspace( bool restore )
|
||||||
popupinfo (0),
|
popupinfo (0),
|
||||||
popup (0),
|
popup (0),
|
||||||
advanced_popup (0),
|
advanced_popup (0),
|
||||||
trans_popup (0),
|
|
||||||
desk_popup (0),
|
desk_popup (0),
|
||||||
desk_popup_index (0),
|
desk_popup_index (0),
|
||||||
keys (0),
|
keys (0),
|
||||||
|
@ -128,16 +124,12 @@ Workspace::Workspace( bool restore )
|
||||||
topmenu_space( NULL ),
|
topmenu_space( NULL ),
|
||||||
set_active_client_recursion( 0 ),
|
set_active_client_recursion( 0 ),
|
||||||
block_stacking_updates( 0 ),
|
block_stacking_updates( 0 ),
|
||||||
forced_global_mouse_grab( false ),
|
forced_global_mouse_grab( false )
|
||||||
cm_selection( NULL ),
|
|
||||||
compositeRate( 0 ),
|
|
||||||
overlay( None ),
|
|
||||||
transSlider( NULL ),
|
|
||||||
transButton( NULL )
|
|
||||||
{
|
{
|
||||||
(void) new KWinAdaptor( this );
|
(void) new KWinAdaptor( this );
|
||||||
QDBusConnection::sessionBus().registerObject("/KWin", this);
|
QDBusConnection dbus = QDBusConnection::sessionBus();
|
||||||
|
dbus.registerObject("/KWin", this);
|
||||||
|
dbus.connect(QString(), "/KWin", "org.kde.KWin", "reloadConfig", this, SLOT(slotReloadConfig()));
|
||||||
_self = this;
|
_self = this;
|
||||||
mgr = new PluginMgr;
|
mgr = new PluginMgr;
|
||||||
root = rootWindow();
|
root = rootWindow();
|
||||||
|
@ -178,12 +170,10 @@ Workspace::Workspace( bool restore )
|
||||||
ColormapChangeMask |
|
ColormapChangeMask |
|
||||||
SubstructureRedirectMask |
|
SubstructureRedirectMask |
|
||||||
SubstructureNotifyMask |
|
SubstructureNotifyMask |
|
||||||
FocusChangeMask | // for NotifyDetailNone
|
FocusChangeMask // for NotifyDetailNone
|
||||||
ExposureMask
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Extensions::init();
|
Shape::init();
|
||||||
setupCompositing();
|
|
||||||
|
|
||||||
// compatibility
|
// compatibility
|
||||||
long data = 1;
|
long data = 1;
|
||||||
|
@ -289,6 +279,7 @@ void Workspace::init()
|
||||||
NET::WM2ExtendedStrut |
|
NET::WM2ExtendedStrut |
|
||||||
NET::WM2KDETemporaryRules |
|
NET::WM2KDETemporaryRules |
|
||||||
NET::WM2ShowingDesktop |
|
NET::WM2ShowingDesktop |
|
||||||
|
NET::WM2DesktopLayout |
|
||||||
0
|
0
|
||||||
,
|
,
|
||||||
NET::ActionMove |
|
NET::ActionMove |
|
||||||
|
@ -332,7 +323,6 @@ void Workspace::init()
|
||||||
connect(&reconfigureTimer, SIGNAL(timeout()), this,
|
connect(&reconfigureTimer, SIGNAL(timeout()), this,
|
||||||
SLOT(slotReconfigure()));
|
SLOT(slotReconfigure()));
|
||||||
connect( &updateToolWindowsTimer, SIGNAL( timeout()), this, SLOT( slotUpdateToolWindows()));
|
connect( &updateToolWindowsTimer, SIGNAL( timeout()), this, SLOT( slotUpdateToolWindows()));
|
||||||
connect( &compositeTimer, SIGNAL( timeout()), SLOT( performCompositing()));
|
|
||||||
|
|
||||||
connect(KGlobalSettings::self(), SIGNAL(appearanceChanged()), this,
|
connect(KGlobalSettings::self(), SIGNAL(appearanceChanged()), this,
|
||||||
SLOT(slotReconfigure()));
|
SLOT(slotReconfigure()));
|
||||||
|
@ -370,10 +360,7 @@ void Workspace::init()
|
||||||
XWindowAttributes attr;
|
XWindowAttributes attr;
|
||||||
XGetWindowAttributes(display(), wins[i], &attr);
|
XGetWindowAttributes(display(), wins[i], &attr);
|
||||||
if (attr.override_redirect )
|
if (attr.override_redirect )
|
||||||
{
|
|
||||||
createUnmanaged( wins[ i ] );
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
if( topmenu_space && topmenu_space->winId() == wins[ i ] )
|
if( topmenu_space && topmenu_space->winId() == wins[ i ] )
|
||||||
continue;
|
continue;
|
||||||
if (attr.map_state != IsUnmapped)
|
if (attr.map_state != IsUnmapped)
|
||||||
|
@ -435,7 +422,6 @@ void Workspace::init()
|
||||||
|
|
||||||
Workspace::~Workspace()
|
Workspace::~Workspace()
|
||||||
{
|
{
|
||||||
finishCompositing();
|
|
||||||
blockStackingUpdates( true );
|
blockStackingUpdates( true );
|
||||||
// TODO grabXServer();
|
// TODO grabXServer();
|
||||||
// use stacking_order, so that kwin --replace keeps stacking order
|
// use stacking_order, so that kwin --replace keeps stacking order
|
||||||
|
@ -445,12 +431,12 @@ Workspace::~Workspace()
|
||||||
{
|
{
|
||||||
// only release the window
|
// only release the window
|
||||||
(*it)->releaseWindow( true );
|
(*it)->releaseWindow( true );
|
||||||
// no removeClient() is called !
|
// No removeClient() is called, it does more than just removing.
|
||||||
|
// However, remove from some lists to e.g. prevent performTransiencyCheck()
|
||||||
|
// from crashing.
|
||||||
|
clients.remove( *it );
|
||||||
|
desktops.remove( *it );
|
||||||
}
|
}
|
||||||
for( UnmanagedList::ConstIterator it = unmanaged.begin();
|
|
||||||
it != unmanaged.end();
|
|
||||||
++it )
|
|
||||||
(*it)->release();
|
|
||||||
delete desktop_widget;
|
delete desktop_widget;
|
||||||
delete tab_box;
|
delete tab_box;
|
||||||
delete popupinfo;
|
delete popupinfo;
|
||||||
|
@ -494,28 +480,6 @@ Client* Workspace::createClient( Window w, bool is_mapped )
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
addClient( c, Allowed );
|
addClient( c, Allowed );
|
||||||
if( scene )
|
|
||||||
scene->windowAdded( c );
|
|
||||||
if( effects )
|
|
||||||
effects->windowAdded( c->effectWindow());
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
Unmanaged* Workspace::createUnmanaged( Window w )
|
|
||||||
{
|
|
||||||
if( w == overlay )
|
|
||||||
return NULL;
|
|
||||||
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->effectWindow());
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,13 +520,7 @@ void Workspace::addClient( Client* c, allowed_t )
|
||||||
updateStackingOrder( true ); // propagate new client
|
updateStackingOrder( true ); // propagate new client
|
||||||
if( c->isUtility() || c->isMenu() || c->isToolbar())
|
if( c->isUtility() || c->isMenu() || c->isToolbar())
|
||||||
updateToolWindows( true );
|
updateToolWindows( true );
|
||||||
if( tab_grab )
|
checkNonExistentClients();
|
||||||
tab_box->reset( true );
|
|
||||||
}
|
|
||||||
|
|
||||||
void Workspace::addUnmanaged( Unmanaged* c, allowed_t )
|
|
||||||
{
|
|
||||||
unmanaged.append( c );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -583,12 +541,6 @@ void Workspace::removeClient( Client* c, allowed_t )
|
||||||
if( c->isNormalWindow())
|
if( c->isNormalWindow())
|
||||||
Notify::raise( Notify::Delete );
|
Notify::raise( Notify::Delete );
|
||||||
|
|
||||||
if( tab_grab )
|
|
||||||
{
|
|
||||||
if( tab_box->currentClient() == c )
|
|
||||||
tab_box->nextPrev( true );
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_ASSERT( clients.contains( c ) || desktops.contains( c ));
|
Q_ASSERT( clients.contains( c ) || desktops.contains( c ));
|
||||||
clients.removeAll( c );
|
clients.removeAll( c );
|
||||||
desktops.removeAll( c );
|
desktops.removeAll( c );
|
||||||
|
@ -619,34 +571,12 @@ void Workspace::removeClient( Client* c, allowed_t )
|
||||||
|
|
||||||
updateStackingOrder( true );
|
updateStackingOrder( true );
|
||||||
|
|
||||||
if( tab_grab )
|
if (tab_grab)
|
||||||
tab_box->reset( true );
|
tab_box->repaint();
|
||||||
|
|
||||||
updateClientArea();
|
updateClientArea();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::removeUnmanaged( Unmanaged* c, allowed_t )
|
|
||||||
{
|
|
||||||
assert( unmanaged.contains( c ));
|
|
||||||
unmanaged.removeAll( c );
|
|
||||||
}
|
|
||||||
|
|
||||||
void Workspace::addDeleted( Deleted* c, allowed_t )
|
|
||||||
{
|
|
||||||
assert( !deleted.contains( c ));
|
|
||||||
deleted.append( c );
|
|
||||||
}
|
|
||||||
|
|
||||||
void Workspace::removeDeleted( Deleted* c, allowed_t )
|
|
||||||
{
|
|
||||||
assert( deleted.contains( c ));
|
|
||||||
if( scene )
|
|
||||||
scene->windowDeleted( c );
|
|
||||||
if( effects )
|
|
||||||
effects->windowDeleted( c->effectWindow());
|
|
||||||
deleted.removeAll( c );
|
|
||||||
}
|
|
||||||
|
|
||||||
void Workspace::updateFocusChains( Client* c, FocusChainChange change )
|
void Workspace::updateFocusChains( Client* c, FocusChainChange change )
|
||||||
{
|
{
|
||||||
if( !c->wantsTabFocus()) // doesn't want tab focus, remove
|
if( !c->wantsTabFocus()) // doesn't want tab focus, remove
|
||||||
|
@ -672,7 +602,13 @@ void Workspace::updateFocusChains( Client* c, FocusChainChange change )
|
||||||
focus_chain[ i ].prepend( c );
|
focus_chain[ i ].prepend( c );
|
||||||
}
|
}
|
||||||
else if( !focus_chain[ i ].contains( c ))
|
else if( !focus_chain[ i ].contains( c ))
|
||||||
focus_chain[ i ].prepend( c ); // otherwise add as the last one
|
{ // add it after the active one
|
||||||
|
if( active_client != NULL && active_client != c
|
||||||
|
&& !focus_chain[ i ].isEmpty() && focus_chain[ i ].last() == active_client )
|
||||||
|
focus_chain[ i ].insert( focus_chain[ i ].size() - 1, c );
|
||||||
|
else
|
||||||
|
focus_chain[ i ].append( c ); // otherwise add as the first one
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else //now only on desktop, remove it anywhere else
|
else //now only on desktop, remove it anywhere else
|
||||||
|
@ -692,7 +628,13 @@ void Workspace::updateFocusChains( Client* c, FocusChainChange change )
|
||||||
focus_chain[ i ].prepend( c );
|
focus_chain[ i ].prepend( c );
|
||||||
}
|
}
|
||||||
else if( !focus_chain[ i ].contains( c ))
|
else if( !focus_chain[ i ].contains( c ))
|
||||||
focus_chain[ i ].prepend( c );
|
{ // add it after the active one
|
||||||
|
if( active_client != NULL && active_client != c
|
||||||
|
&& !focus_chain[ i ].isEmpty() && focus_chain[ i ].last() == active_client )
|
||||||
|
focus_chain[ i ].insert( focus_chain[ i ].size() - 1, c );
|
||||||
|
else
|
||||||
|
focus_chain[ i ].append( c ); // otherwise add as the first one
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
focus_chain[ i ].removeAll( c );
|
focus_chain[ i ].removeAll( c );
|
||||||
|
@ -709,7 +651,13 @@ void Workspace::updateFocusChains( Client* c, FocusChainChange change )
|
||||||
global_focus_chain.prepend( c );
|
global_focus_chain.prepend( c );
|
||||||
}
|
}
|
||||||
else if( !global_focus_chain.contains( c ))
|
else if( !global_focus_chain.contains( c ))
|
||||||
global_focus_chain.prepend( c );
|
{ // add it after the active one
|
||||||
|
if( active_client != NULL && active_client != c
|
||||||
|
&& !global_focus_chain.isEmpty() && global_focus_chain.last() == active_client )
|
||||||
|
global_focus_chain.insert( global_focus_chain.size() - 1, c );
|
||||||
|
else
|
||||||
|
global_focus_chain.append( c ); // otherwise add as the first one
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::updateCurrentTopMenu()
|
void Workspace::updateCurrentTopMenu()
|
||||||
|
@ -927,6 +875,11 @@ void Workspace::updateColormap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Workspace::slotReloadConfig()
|
||||||
|
{
|
||||||
|
reconfigure();
|
||||||
|
}
|
||||||
|
|
||||||
void Workspace::reconfigure()
|
void Workspace::reconfigure()
|
||||||
{
|
{
|
||||||
reconfigureTimer.start( 200 );
|
reconfigureTimer.start( 200 );
|
||||||
|
@ -943,7 +896,7 @@ void Workspace::slotSettingsChanged(int category)
|
||||||
/*!
|
/*!
|
||||||
Reread settings
|
Reread settings
|
||||||
*/
|
*/
|
||||||
KWIN_PROCEDURE( CheckBorderSizesProcedure, Client, cl->checkBorderSizes() );
|
KWIN_PROCEDURE( CheckBorderSizesProcedure, cl->checkBorderSizes() );
|
||||||
|
|
||||||
void Workspace::slotReconfigure()
|
void Workspace::slotReconfigure()
|
||||||
{
|
{
|
||||||
|
@ -1001,11 +954,6 @@ void Workspace::slotReconfigure()
|
||||||
updateCurrentTopMenu();
|
updateCurrentTopMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( options->useTranslucency )
|
|
||||||
setupCompositing();
|
|
||||||
else
|
|
||||||
finishCompositing();
|
|
||||||
|
|
||||||
loadWindowRules();
|
loadWindowRules();
|
||||||
for( ClientList::Iterator it = clients.begin();
|
for( ClientList::Iterator it = clients.begin();
|
||||||
it != clients.end();
|
it != clients.end();
|
||||||
|
@ -1287,15 +1235,16 @@ bool Workspace::setCurrentDesktop( int new_desktop )
|
||||||
// and active_client is on_all_desktops and under mouse (hence == old_active_client),
|
// and active_client is on_all_desktops and under mouse (hence == old_active_client),
|
||||||
// conserve focus (thanks to Volker Schatz <V.Schatz at thphys.uni-heidelberg.de>)
|
// conserve focus (thanks to Volker Schatz <V.Schatz at thphys.uni-heidelberg.de>)
|
||||||
else if( active_client && active_client->isShown( true ) && active_client->isOnCurrentDesktop())
|
else if( active_client && active_client->isShown( true ) && active_client->isOnCurrentDesktop())
|
||||||
c= active_client;
|
c = active_client;
|
||||||
|
|
||||||
|
if( c == NULL && !desktops.isEmpty())
|
||||||
|
c = findDesktop( true, currentDesktop());
|
||||||
|
|
||||||
if( c != active_client )
|
if( c != active_client )
|
||||||
setActiveClient( NULL, Allowed );
|
setActiveClient( NULL, Allowed );
|
||||||
|
|
||||||
if ( c )
|
if ( c )
|
||||||
requestFocus( c );
|
requestFocus( c );
|
||||||
else if( !desktops.isEmpty() )
|
|
||||||
requestFocus( findDesktop( true, currentDesktop()));
|
|
||||||
else
|
else
|
||||||
focusToNull();
|
focusToNull();
|
||||||
|
|
||||||
|
@ -1317,10 +1266,6 @@ bool Workspace::setCurrentDesktop( int new_desktop )
|
||||||
|
|
||||||
if( old_desktop != 0 ) // not for the very first time
|
if( old_desktop != 0 ) // not for the very first time
|
||||||
popupinfo->showInfo( desktopName(currentDesktop()) );
|
popupinfo->showInfo( desktopName(currentDesktop()) );
|
||||||
|
|
||||||
if( effects != NULL && old_desktop != 0 )
|
|
||||||
effects->desktopChanged( old_desktop );
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1553,25 +1498,26 @@ void Workspace::sendClientToDesktop( Client* c, int desk, bool dont_activate )
|
||||||
updateClientArea();
|
updateClientArea();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::setDesktopLayout(int o, int x, int y)
|
void Workspace::setDesktopLayout(NET::Orientation o, int x, int y,NET::DesktopLayoutCorner c)
|
||||||
{
|
{
|
||||||
layoutOrientation = (Qt::Orientation) o;
|
Q_UNUSED( c ); // I don't find this worth bothering, feel free to
|
||||||
|
layoutOrientation = ( o == NET::OrientationHorizontal ? Qt::Horizontal : Qt::Vertical );
|
||||||
layoutX = x;
|
layoutX = x;
|
||||||
layoutY = y;
|
layoutY = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::calcDesktopLayout(int &x, int &y) const
|
void Workspace::calcDesktopLayout(int &x, int &y) const
|
||||||
{
|
{
|
||||||
x = layoutX;
|
x = layoutX; // <= 0 means compute it from the other and total number of desktops
|
||||||
y = layoutY;
|
y = layoutY;
|
||||||
if ((x == -1) && (y > 0))
|
if((x <= 0) && (y > 0))
|
||||||
x = (numberOfDesktops()+y-1) / y;
|
x = (numberOfDesktops()+y-1) / y;
|
||||||
else if ((y == -1) && (x > 0))
|
else if((y <=0) && (x > 0))
|
||||||
y = (numberOfDesktops()+x-1) / x;
|
y = (numberOfDesktops()+x-1) / x;
|
||||||
|
|
||||||
if (x == -1)
|
if(x <=0)
|
||||||
x = 1;
|
x = 1;
|
||||||
if (y == -1)
|
if (y <= 0)
|
||||||
y = 1;
|
y = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1703,7 +1649,7 @@ void Workspace::slotGrabWindow()
|
||||||
QPixmap snapshot = QPixmap::grabWindow( active_client->frameId() );
|
QPixmap snapshot = QPixmap::grabWindow( active_client->frameId() );
|
||||||
|
|
||||||
//No XShape - no work.
|
//No XShape - no work.
|
||||||
if( Extensions::shapeAvailable())
|
if( Shape::available())
|
||||||
{
|
{
|
||||||
//As the first step, get the mask from XShape.
|
//As the first step, get the mask from XShape.
|
||||||
int count, order;
|
int count, order;
|
||||||
|
@ -1904,7 +1850,7 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent& ev )
|
||||||
bool is_alt = km & Mod1Mask;
|
bool is_alt = km & Mod1Mask;
|
||||||
bool is_shift = km & ShiftMask;
|
bool is_shift = km & ShiftMask;
|
||||||
int delta = is_control?1:is_alt?32:8;
|
int delta = is_control?1:is_alt?32:8;
|
||||||
QPoint pos = cursorPos();
|
QPoint pos = QCursor::pos();
|
||||||
|
|
||||||
switch ( kc )
|
switch ( kc )
|
||||||
{
|
{
|
||||||
|
@ -2056,8 +2002,7 @@ void Workspace::createBorderWindows()
|
||||||
XSetWindowAttributes attributes;
|
XSetWindowAttributes attributes;
|
||||||
unsigned long valuemask;
|
unsigned long valuemask;
|
||||||
attributes.override_redirect = True;
|
attributes.override_redirect = True;
|
||||||
attributes.event_mask = (EnterWindowMask | LeaveWindowMask |
|
attributes.event_mask = ( EnterWindowMask | LeaveWindowMask );
|
||||||
VisibilityChangeMask);
|
|
||||||
valuemask= (CWOverrideRedirect | CWEventMask | CWCursor );
|
valuemask= (CWOverrideRedirect | CWEventMask | CWCursor );
|
||||||
attributes.cursor = XCreateFontCursor(display(),
|
attributes.cursor = XCreateFontCursor(display(),
|
||||||
XC_sb_up_arrow);
|
XC_sb_up_arrow);
|
||||||
|
@ -2449,7 +2394,7 @@ void Workspace::helperDialog( const QString& message, const Client* c )
|
||||||
{
|
{
|
||||||
KConfig cfg( "kwin_dialogsrc" );
|
KConfig cfg( "kwin_dialogsrc" );
|
||||||
KConfigGroup cg(&cfg, "Notification Messages" ); // this depends on KMessageBox
|
KConfigGroup cg(&cfg, "Notification Messages" ); // this depends on KMessageBox
|
||||||
if( !cg.readEntry( type, QVariant(true )).toBool()) // has don't show again checked
|
if( !cg.readEntry( type, true )) // has don't show again checked
|
||||||
return; // save launching kdialog
|
return; // save launching kdialog
|
||||||
proc << "--dontagain" << "kwin_dialogsrc:" + type;
|
proc << "--dontagain" << "kwin_dialogsrc:" + type;
|
||||||
}
|
}
|
||||||
|
|
101
workspace.h
101
workspace.h
|
@ -18,8 +18,6 @@ License. See the file "COPYING" for the exact licensing terms.
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
#include <netwm.h>
|
#include <netwm.h>
|
||||||
#include <kxmessages.h>
|
#include <kxmessages.h>
|
||||||
#include <qdatetime.h>
|
|
||||||
#include <kmanagerselection.h>
|
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "kdecoration.h"
|
#include "kdecoration.h"
|
||||||
|
@ -89,9 +87,6 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
template< typename T > Client* findClient( T predicate );
|
template< typename T > Client* findClient( T predicate );
|
||||||
template< typename T1, typename T2 > void forEachClient( T1 procedure, T2 predicate );
|
template< typename T1, typename T2 > void forEachClient( T1 procedure, T2 predicate );
|
||||||
template< typename T > void forEachClient( T procedure );
|
template< typename T > void forEachClient( T procedure );
|
||||||
template< typename T > Unmanaged* findUnmanaged( T predicate );
|
|
||||||
template< typename T1, typename T2 > void forEachUnmanaged( T1 procedure, T2 predicate );
|
|
||||||
template< typename T > void forEachUnmanaged( T procedure );
|
|
||||||
|
|
||||||
QRect clientArea( clientAreaOption, const QPoint& p, int desktop ) const;
|
QRect clientArea( clientAreaOption, const QPoint& p, int desktop ) const;
|
||||||
QRect clientArea( clientAreaOption, const Client* c ) const;
|
QRect clientArea( clientAreaOption, const Client* c ) const;
|
||||||
|
@ -170,17 +165,12 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
QWidget* desktopWidget();
|
QWidget* desktopWidget();
|
||||||
|
|
||||||
// for TabBox
|
// for TabBox
|
||||||
Client* currentTabBoxClient() const;
|
|
||||||
ClientList currentTabBoxClientList() const;
|
|
||||||
int currentTabBoxDesktop() const;
|
|
||||||
Client* nextFocusChainClient(Client*) const;
|
Client* nextFocusChainClient(Client*) const;
|
||||||
Client* previousFocusChainClient(Client*) const;
|
Client* previousFocusChainClient(Client*) const;
|
||||||
Client* nextStaticClient(Client*) const;
|
Client* nextStaticClient(Client*) const;
|
||||||
Client* previousStaticClient(Client*) const;
|
Client* previousStaticClient(Client*) const;
|
||||||
int nextDesktopFocusChain( int iDesktop ) const;
|
int nextDesktopFocusChain( int iDesktop ) const;
|
||||||
int previousDesktopFocusChain( int iDesktop ) const;
|
int previousDesktopFocusChain( int iDesktop ) const;
|
||||||
void refTabBox();
|
|
||||||
void unrefTabBox();
|
|
||||||
void closeTabBox();
|
void closeTabBox();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -191,7 +181,7 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
|
|
||||||
ClientList ensureStackingOrder( const ClientList& clients ) const;
|
ClientList ensureStackingOrder( const ClientList& clients ) const;
|
||||||
|
|
||||||
Client* topClientOnDesktop( int desktop, bool unconstrained = false ) const;
|
Client* topClientOnDesktop( int desktop, bool unconstrained = false, bool only_normal = true ) const;
|
||||||
Client* findDesktop( bool topmost, int desktop ) const;
|
Client* findDesktop( bool topmost, int desktop ) const;
|
||||||
void sendClientToDesktop( Client* c, int desktop, bool dont_activate );
|
void sendClientToDesktop( Client* c, int desktop, bool dont_activate );
|
||||||
void windowToPreviousDesktop( Client* c );
|
void windowToPreviousDesktop( Client* c );
|
||||||
|
@ -200,10 +190,6 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
// KDE4 remove me - and it's also in the DCOP interface :(
|
// KDE4 remove me - and it's also in the DCOP interface :(
|
||||||
void showWindowMenuAt( unsigned long id, int x, int y );
|
void showWindowMenuAt( unsigned long id, int x, int y );
|
||||||
|
|
||||||
void loadEffect( const QString& name );
|
|
||||||
|
|
||||||
void unloadEffect( const QString& name );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows the menu operations menu for the client and makes it active if
|
* Shows the menu operations menu for the client and makes it active if
|
||||||
* it's not already.
|
* it's not already.
|
||||||
|
@ -227,6 +213,8 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
WindowRules findWindowRules( const Client*, bool );
|
WindowRules findWindowRules( const Client*, bool );
|
||||||
void rulesUpdated();
|
void rulesUpdated();
|
||||||
void discardUsedWindowRules( Client* c, bool withdraw );
|
void discardUsedWindowRules( Client* c, bool withdraw );
|
||||||
|
void disableRulesUpdates( bool disable );
|
||||||
|
bool rulesUpdatesDisabled() const;
|
||||||
|
|
||||||
// dcop interface
|
// dcop interface
|
||||||
void cascadeDesktop();
|
void cascadeDesktop();
|
||||||
|
@ -238,7 +226,7 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
void circulateDesktopApplications();
|
void circulateDesktopApplications();
|
||||||
|
|
||||||
QString desktopName( int desk ) const;
|
QString desktopName( int desk ) const;
|
||||||
void setDesktopLayout(int o, int x, int y);
|
void setDesktopLayout(NET::Orientation o, int x, int y, NET::DesktopLayoutCorner c);
|
||||||
void setShowingDesktop( bool showing );
|
void setShowingDesktop( bool showing );
|
||||||
void resetShowingDesktop( bool keep_hidden );
|
void resetShowingDesktop( bool keep_hidden );
|
||||||
bool showingDesktop() const;
|
bool showingDesktop() const;
|
||||||
|
@ -248,17 +236,14 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
void sendPingToWindow( Window w, Time timestamp ); // called from Client::pingWindow()
|
void sendPingToWindow( Window w, Time timestamp ); // called from Client::pingWindow()
|
||||||
void sendTakeActivity( Client* c, Time timestamp, long flags ); // called from Client::takeActivity()
|
void sendTakeActivity( Client* c, Time timestamp, long flags ); // called from Client::takeActivity()
|
||||||
|
|
||||||
void removeClient( Client*, allowed_t ); // only called from Client::destroyClient() or Client::releaseWindow()
|
// only called from Client::destroyClient() or Client::releaseWindow()
|
||||||
|
void removeClient( Client*, allowed_t );
|
||||||
void setActiveClient( Client*, allowed_t );
|
void setActiveClient( Client*, allowed_t );
|
||||||
Group* findGroup( Window leader ) const;
|
Group* findGroup( Window leader ) const;
|
||||||
void addGroup( Group* group, allowed_t );
|
void addGroup( Group* group, allowed_t );
|
||||||
void removeGroup( Group* group, allowed_t );
|
void removeGroup( Group* group, allowed_t );
|
||||||
Group* findClientLeaderGroup( const Client* c ) const;
|
Group* findClientLeaderGroup( const Client* c ) const;
|
||||||
|
|
||||||
void removeUnmanaged( Unmanaged*, allowed_t ); // only called from Unmanaged::release()
|
|
||||||
void removeDeleted( Deleted*, allowed_t );
|
|
||||||
void addDeleted( Deleted*, allowed_t );
|
|
||||||
|
|
||||||
bool checkStartupNotification( Window w, KStartupInfoId& id, KStartupInfoData& data );
|
bool checkStartupNotification( Window w, KStartupInfoId& id, KStartupInfoData& data );
|
||||||
|
|
||||||
void focusToNull(); // SELI public?
|
void focusToNull(); // SELI public?
|
||||||
|
@ -294,17 +279,6 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
|
|
||||||
void toggleTopDockShadows(bool on);
|
void toggleTopDockShadows(bool on);
|
||||||
|
|
||||||
void addRepaint( const QRect& r );
|
|
||||||
void addRepaint( int x, int y, int w, int h );
|
|
||||||
void addRepaintFull();
|
|
||||||
// creates XComposite overlay window, call initOverlay() afterwards
|
|
||||||
bool createOverlay();
|
|
||||||
// init overlay and the destination window in it
|
|
||||||
void setupOverlay( Window window );
|
|
||||||
// destroys XComposite overlay window
|
|
||||||
void destroyOverlay();
|
|
||||||
Window overlayWindow();
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void refresh();
|
void refresh();
|
||||||
// keybindings
|
// keybindings
|
||||||
|
@ -434,14 +408,15 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
void cleanupTemporaryRules();
|
void cleanupTemporaryRules();
|
||||||
void writeWindowRules();
|
void writeWindowRules();
|
||||||
void slotBlockShortcuts(int data);
|
void slotBlockShortcuts(int data);
|
||||||
void setPopupClientOpacity( QAction* action );
|
void slotReloadConfig();
|
||||||
void setupCompositing();
|
// kompmgr
|
||||||
void performCompositing();
|
void setPopupClientOpacity(int v);
|
||||||
void lostCMSelection();
|
void resetClientOpacity();
|
||||||
|
void setTransButtonText(int value);
|
||||||
|
// end
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool keyPressMouseEmulation( XKeyEvent& ev );
|
bool keyPressMouseEmulation( XKeyEvent& ev );
|
||||||
bool netCheck( XEvent* e );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
|
@ -485,8 +460,6 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
// this is the right way to create a new client
|
// this is the right way to create a new client
|
||||||
Client* createClient( Window w, bool is_mapped );
|
Client* createClient( Window w, bool is_mapped );
|
||||||
void addClient( Client* c, allowed_t );
|
void addClient( Client* c, allowed_t );
|
||||||
Unmanaged* createUnmanaged( Window w );
|
|
||||||
void addUnmanaged( Unmanaged* c, allowed_t );
|
|
||||||
|
|
||||||
Window findSpecialEventWindow( XEvent* e );
|
Window findSpecialEventWindow( XEvent* e );
|
||||||
|
|
||||||
|
@ -529,9 +502,6 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
|
|
||||||
void updateClientArea( bool force );
|
void updateClientArea( bool force );
|
||||||
|
|
||||||
void finishCompositing();
|
|
||||||
bool windowRepaintsPending() const;
|
|
||||||
|
|
||||||
SystemTrayWindowList systemTrayWins;
|
SystemTrayWindowList systemTrayWins;
|
||||||
|
|
||||||
int current_desktop;
|
int current_desktop;
|
||||||
|
@ -551,6 +521,7 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
QList<Rules*> rules;
|
QList<Rules*> rules;
|
||||||
KXMessages temporaryRulesMessages;
|
KXMessages temporaryRulesMessages;
|
||||||
QTimer rulesUpdatedTimer;
|
QTimer rulesUpdatedTimer;
|
||||||
|
bool rules_updates_disabled;
|
||||||
static const char* windowTypeToTxt( NET::WindowType type );
|
static const char* windowTypeToTxt( NET::WindowType type );
|
||||||
static NET::WindowType txtToWindowType( const char* txt );
|
static NET::WindowType txtToWindowType( const char* txt );
|
||||||
static bool sessionInfoWindowTypeMatch( Client* c, SessionInfo* info );
|
static bool sessionInfoWindowTypeMatch( Client* c, SessionInfo* info );
|
||||||
|
@ -567,12 +538,10 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
|
|
||||||
ClientList clients;
|
ClientList clients;
|
||||||
ClientList desktops;
|
ClientList desktops;
|
||||||
UnmanagedList unmanaged;
|
|
||||||
DeletedList deleted;
|
|
||||||
|
|
||||||
ClientList unconstrained_stacking_order;
|
ClientList unconstrained_stacking_order; // topmost last
|
||||||
ClientList stacking_order;
|
ClientList stacking_order; // topmost last
|
||||||
QVector< ClientList > focus_chain;
|
QVector< ClientList > focus_chain; // currently ative last
|
||||||
ClientList global_focus_chain; // this one is only for things like tabbox's MRU
|
ClientList global_focus_chain; // this one is only for things like tabbox's MRU
|
||||||
ClientList should_get_focus; // last is most recent
|
ClientList should_get_focus; // last is most recent
|
||||||
ClientList attention_chain;
|
ClientList attention_chain;
|
||||||
|
@ -606,7 +575,6 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
|
|
||||||
QMenu *popup;
|
QMenu *popup;
|
||||||
QMenu *advanced_popup;
|
QMenu *advanced_popup;
|
||||||
QMenu *trans_popup;
|
|
||||||
QMenu *desk_popup;
|
QMenu *desk_popup;
|
||||||
int desk_popup_index;
|
int desk_popup_index;
|
||||||
|
|
||||||
|
@ -690,14 +658,12 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
bool forced_global_mouse_grab;
|
bool forced_global_mouse_grab;
|
||||||
friend class StackingUpdatesBlocker;
|
friend class StackingUpdatesBlocker;
|
||||||
|
|
||||||
KSelectionOwner* cm_selection;
|
//kompmgr
|
||||||
QTimer compositeTimer;
|
|
||||||
QTime lastCompositePaint;
|
|
||||||
int compositeRate;
|
|
||||||
QRegion repaints_region;
|
|
||||||
Window overlay; // XComposite overlay window
|
|
||||||
QSlider *transSlider;
|
QSlider *transSlider;
|
||||||
QPushButton *transButton;
|
QPushButton *transButton;
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend bool performTransiencyCheck();
|
||||||
};
|
};
|
||||||
|
|
||||||
// helper for Workspace::blockStackingUpdates() being called in pairs (true/false)
|
// helper for Workspace::blockStackingUpdates() being called in pairs (true/false)
|
||||||
|
@ -840,9 +806,10 @@ inline bool Workspace::globalShortcutsDisabled() const
|
||||||
return global_shortcuts_disabled || global_shortcuts_disabled_for_client;
|
return global_shortcuts_disabled || global_shortcuts_disabled_for_client;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Window Workspace::overlayWindow()
|
inline
|
||||||
|
bool Workspace::rulesUpdatesDisabled() const
|
||||||
{
|
{
|
||||||
return overlay;
|
return rules_updates_disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
|
@ -872,27 +839,7 @@ inline void Workspace::forEachClient( T procedure )
|
||||||
return forEachClient( procedure, TruePredicate());
|
return forEachClient( procedure, TruePredicate());
|
||||||
}
|
}
|
||||||
|
|
||||||
template< typename T >
|
KWIN_COMPARE_PREDICATE( ClientMatchPredicate, const Client*, cl == value );
|
||||||
inline Unmanaged* Workspace::findUnmanaged( T predicate )
|
|
||||||
{
|
|
||||||
return findUnmanagedInList( unmanaged, predicate );
|
|
||||||
}
|
|
||||||
|
|
||||||
template< typename T1, typename T2 >
|
|
||||||
inline void Workspace::forEachUnmanaged( T1 procedure, T2 predicate )
|
|
||||||
{
|
|
||||||
for ( UnmanagedList::ConstIterator it = unmanaged.begin(); it != unmanaged.end(); ++it)
|
|
||||||
if ( predicate( const_cast< const Unmanaged* >( *it)))
|
|
||||||
procedure( *it );
|
|
||||||
}
|
|
||||||
|
|
||||||
template< typename T >
|
|
||||||
inline void Workspace::forEachUnmanaged( T procedure )
|
|
||||||
{
|
|
||||||
return forEachUnmanaged( procedure, TruePredicate());
|
|
||||||
}
|
|
||||||
|
|
||||||
KWIN_COMPARE_PREDICATE( ClientMatchPredicate, Client, const Client*, cl == value );
|
|
||||||
inline bool Workspace::hasClient( const Client* c )
|
inline bool Workspace::hasClient( const Client* c )
|
||||||
{
|
{
|
||||||
return findClient( ClientMatchPredicate( c ));
|
return findClient( ClientMatchPredicate( c ));
|
||||||
|
|
Loading…
Reference in New Issue