SVN_SILENT Standardize coding style on client.* and workspace.*

svn path=/trunk/KDE/kdebase/workspace/; revision=898612
This commit is contained in:
Lucas Murray 2008-12-18 13:50:57 +00:00
parent 5f3b538cde
commit 038667db7a
4 changed files with 1567 additions and 1549 deletions

File diff suppressed because it is too large Load diff

166
client.h
View file

@ -46,6 +46,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <X11/extensions/sync.h>
#endif
// TODO: Cleanup the order of things in this .h file
class QProcess;
class QTimer;
class KStartupInfoData;
@ -71,10 +73,10 @@ class Client
bool isTransient() const;
bool groupTransient() const;
bool wasOriginallyGroupTransient() const;
ClientList mainClients() const; // call once before loop , is not indirect
ClientList allMainClients() const; // call once before loop , is indirect
ClientList mainClients() const; // Call once before loop , is not indirect
ClientList allMainClients() const; // Call once before loop , is indirect
bool hasTransient( const Client* c, bool indirect ) const;
const ClientList& transients() const; // is not indirect
const ClientList& transients() const; // Is not indirect
void checkTransient( Window w );
Client* findModal( bool allow_itself = false );
const Group* group() const;
@ -88,16 +90,18 @@ class Client
void updateWindowRules();
void updateFullscreenMonitors( NETFullscreenMonitors topology );
// 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
/**
* 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 hasNETSupport() const;
QSize minSize() const;
QSize maxSize() const;
virtual QPoint clientPos() const; // inside of geometry()
virtual QPoint clientPos() const; // Inside of geometry()
virtual QSize clientSize() const;
bool windowEvent( XEvent* e );
@ -110,12 +114,13 @@ class Client
void releaseWindow( bool on_shutdown = false );
void destroyClient();
enum Sizemode // how to resize the window in order to obey constains (mainly aspect ratios)
/// How to resize the window in order to obey constains (mainly aspect ratios)
enum Sizemode
{
SizemodeAny,
SizemodeFixedW, // try not to affect width
SizemodeFixedH, // try not to affect height
SizemodeMax // try not to make it larger in either direction
SizemodeFixedW, ///< Try not to affect width
SizemodeFixedH, ///< Try not to affect height
SizemodeMax ///< Try not to make it larger in either direction
};
QSize adjustedSize( const QSize&, Sizemode mode = SizemodeAny ) const;
QSize adjustedSize() const;
@ -130,12 +135,12 @@ class Client
void setDesktop( int );
void setOnAllDesktops( bool set );
// !isMinimized() && not hidden, i.e. normally visible on some virtual desktop
/// Is not minimized and not hidden. I.e. normally visible on some virtual desktop.
bool isShown( bool shaded_is_shown ) const;
bool isHiddenInternal() const; // for compositing
bool isHiddenInternal() const; // For compositing
bool isShade() const; // true only for ShadeNormal
ShadeMode shadeMode() const; // prefer isShade()
bool isShade() const; // True only for ShadeNormal
ShadeMode shadeMode() const; // Prefer isShade()
void setShade( ShadeMode mode );
bool isShadeable() const;
@ -153,7 +158,7 @@ class Client
bool isFullScreenable( bool fullscreen_hack = false ) const;
bool isActiveFullScreen() const;
bool userCanSetFullScreen() const;
QRect geometryFSRestore() const { return geom_fs_restore; } // only for session saving
QRect geometryFSRestore() const { return geom_fs_restore; } // Only for session saving
int fullScreenMode() const { return fullscreen_mode; } // only for session saving
bool noBorder() const;
@ -178,16 +183,16 @@ class Client
void setModal( bool modal );
bool isModal() const;
// auxiliary functions, depend on the windowType
// Auxiliary functions, depend on the windowType
bool wantsTabFocus() const;
bool wantsInput() const;
bool isResizable() const;
bool isMovable() const;
bool isMovableAcrossScreens() 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)
void takeFocus( allowed_t );
void demandAttention( bool set = true );
@ -204,10 +209,10 @@ class Client
void setGeometry( const QRect& r, ForceGeometry_t force = NormalGeometrySet );
void move( int x, int y, ForceGeometry_t force = NormalGeometrySet );
void move( const QPoint& p, ForceGeometry_t force = NormalGeometrySet );
// plainResize() simply resizes
/// plainResize() simply resizes
void plainResize( int w, int h, ForceGeometry_t force = NormalGeometrySet );
void plainResize( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
// resizeWithChecks() resizes according to gravity, and checks workarea position
/// resizeWithChecks() resizes according to gravity, and checks workarea position
void resizeWithChecks( int w, int h, ForceGeometry_t force = NormalGeometrySet );
void resizeWithChecks( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
void keepInArea( QRect area, bool partial = false );
@ -227,11 +232,11 @@ class Client
Colormap colormap() const;
// updates visibility depending on being shaded, virtual desktop, etc.
/// Updates visibility depending on being shaded, virtual desktop, etc.
void updateVisibility();
// hides a client - basically like minimize, but without effects, it's simply hidden
/// Hides a client - Basically like minimize, but without effects, it's simply hidden
void hideClient( bool hide );
bool hiddenPreview() const; // window is mapped in order to get a window pixmap
bool hiddenPreview() const; ///< Window is mapped in order to get a window pixmap
virtual void setupCompositing();
virtual void finishCompositing();
@ -247,7 +252,8 @@ class Client
void NETMoveResize( int x_root, int y_root, NET::Direction direction );
void NETMoveResizeWindow( int flags, int x, int y, int width, int height );
void restackWindow( Window above, int detail, NET::RequestSource source, Time timestamp, bool send_event = false );
void restackWindow( Window above, int detail, NET::RequestSource source, Time timestamp,
bool send_event = false );
void gotPing( Time timestamp );
@ -257,7 +263,7 @@ class Client
bool hasUserTimeSupport() const;
bool ignoreFocusStealing() const;
// does 'delete c;'
/// Does 'delete c;'
static void deleteClient( Client* c, allowed_t );
static bool belongToSameApplication( const Client* c1, const Client* c2, bool active_hack = false );
@ -302,19 +308,19 @@ class Client
friend class Bridge; // FRAME
virtual void processMousePressEvent( QMouseEvent* e );
private: // TODO cleanup the order of things in the .h file
// use Workspace::createClient()
virtual ~Client(); // use destroyClient() or releaseWindow()
private:
// Use Workspace::createClient()
virtual ~Client(); ///< Use destroyClient() or releaseWindow()
Position mousePosition( const QPoint& ) const;
void updateCursor();
// transparent stuff
// Transparent stuff
void drawbound( const QRect& geom );
void clearbound();
void doDrawbound( const QRect& geom, bool clear );
// handlers for X11 events
// Handlers for X11 events
bool mapRequestEvent( XMapRequestEvent* e );
void unmapNotifyEvent( XUnmapEvent* e );
void destroyNotifyEvent( XDestroyWindowEvent* e );
@ -348,13 +354,13 @@ class Client
private:
void exportMappingState( int s ); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1
bool isManaged() const; // returns false if this client is not yet managed
bool isManaged() const; ///< Returns false if this client is not yet managed
void updateAllowedActions( bool force = false );
QSize sizeForClientSize( const QSize&, Sizemode mode = SizemodeAny, bool noframe = false ) const;
QRect fullscreenMonitorsArea( NETFullscreenMonitors topology ) const;
void changeMaximize( bool horizontal, bool vertical, bool adjust );
void checkMaximizeGeometry();
int checkFullScreenHack( const QRect& geom ) const; // 0 - none, 1 - one xinerama screen, 2 - full area
int checkFullScreenHack( const QRect& geom ) const; // 0 - None, 1 - One xinerama screen, 2 - Full area
void updateFullScreenHack( const QRect& geom );
void getWmNormalHints();
void getMotifHints();
@ -437,10 +443,10 @@ class Client
void sendSyntheticConfigureNotify();
enum MappingState
{
Withdrawn, // not handled, as per ICCCM WithdrawnState
Mapped, // the frame is mapped
Unmapped, // the frame is not mapped
Kept // the frame should be unmapped, but is kept (for compositing)
Withdrawn, ///< Not handled, as per ICCCM WithdrawnState
Mapped, ///< The frame is mapped
Unmapped, ///< The frame is not mapped
Kept ///< The frame should be unmapped, but is kept (For compositing)
};
MappingState mapping_state;
void readTransient();
@ -454,31 +460,31 @@ class Client
Client* transient_for;
Window transient_for_id;
Window original_transient_for_id;
ClientList transients_list; // SELI make this ordered in stacking order?
ClientList transients_list; // SELI TODO: Make this ordered in stacking order?
ShadeMode shade_mode;
uint active : 1;
uint deleting : 1; // true when doing cleanup and destroying the client
uint keep_above : 1; // NET::KeepAbove (was stays_on_top)
uint deleting : 1; ///< True when doing cleanup and destroying the client
uint keep_above : 1; ///< NET::KeepAbove (was stays_on_top)
uint skip_taskbar : 1;
uint original_skip_taskbar :1; // unaffected by KWin
uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol?
uint Ptakefocus :1;// does the window understand the TakeFocus protocol?
uint Ptakeactivity : 1; // does it support _NET_WM_TAKE_ACTIVITY
uint Pcontexthelp : 1; // does the window understand the ContextHelp protocol?
uint Pping : 1; // does it support _NET_WM_PING?
uint input :1; // does the window want input in its wm_hints
uint original_skip_taskbar : 1; ///< Unaffected by KWin
uint Pdeletewindow : 1; ///< Does the window understand the DeleteWindow protocol?
uint Ptakefocus : 1;///< Does the window understand the TakeFocus protocol?
uint Ptakeactivity : 1; ///< Does it support _NET_WM_TAKE_ACTIVITY
uint Pcontexthelp : 1; ///< Does the window understand the ContextHelp protocol?
uint Pping : 1; ///< Does it support _NET_WM_PING?
uint input : 1; ///< Does the window want input in its wm_hints
uint skip_pager : 1;
uint motif_may_resize : 1;
uint motif_may_move : 1;
uint motif_may_close : 1;
uint keep_below : 1; // NET::KeepBelow
uint keep_below : 1; ///< NET::KeepBelow
uint minimized : 1;
uint hidden : 1; // forcibly hidden by calling hide()
uint modal : 1; // NET::Modal
uint hidden : 1; ///< Forcibly hidden by calling hide()
uint modal : 1; ///< NET::Modal
uint noborder : 1;
uint app_noborder : 1; // the app requested no border using something (window type, motif hints)
uint urgency : 1; // XWMHints, UrgencyHint
uint ignore_focus_stealing : 1; // don't apply focus stealing prevention to this client
uint app_noborder : 1; ///< The app requested no border using something (window type, motif hints)
uint urgency : 1; ///< XWMHints, UrgencyHint
uint ignore_focus_stealing : 1; ///< Don't apply focus stealing prevention to this client
uint demands_attention : 1;
WindowRules client_rules;
void getWMHints();
@ -487,9 +493,13 @@ class Client
QPixmap icon_pix;
QPixmap miniicon_pix;
QCursor cursor;
// FullScreenHack - non-NETWM fullscreen (noborder,size of desktop)
// DON'T reorder - saved to config files !!!
enum FullScreenMode { FullScreenNone, FullScreenNormal, FullScreenHack };
// DON'T reorder - Saved to config files !!!
enum FullScreenMode
{
FullScreenNone,
FullScreenNormal,
FullScreenHack ///< Non-NETWM fullscreen (noborder and size of desktop)
};
FullScreenMode fullscreen_mode;
MaximizeMode max_mode;
QRect geom_restore;
@ -510,8 +520,13 @@ class Client
Time user_time;
unsigned long allowed_actions;
QSize client_size;
int block_geometry_updates; // >0 - new geometry is remembered, but not actually set
enum PendingGeometry_t { PendingGeometryNone, PendingGeometryNormal, PendingGeometryForced };
int block_geometry_updates; // > 0 = New geometry is remembered, but not actually set
enum PendingGeometry_t
{
PendingGeometryNone,
PendingGeometryNormal,
PendingGeometryForced
};
PendingGeometry_t pending_geometry_update;
QRect geom_before_block;
bool shade_geometry_change;
@ -524,7 +539,7 @@ class Client
bool sync_resize_pending;
int border_left, border_right, border_top, border_bottom;
QRegion _mask;
static bool check_active_modal; // see Client::checkActiveModal()
static bool check_active_modal; ///< \see Client::checkActiveModal()
KShortcut _shortcut;
int sm_stacking_order;
friend struct FetchNameInternalPredicate;
@ -536,7 +551,9 @@ class Client
friend bool performTransiencyCheck();
};
// helper for Client::blockGeometryUpdates() being called in pairs (true/false)
/**
* Helper for Client::blockGeometryUpdates() being called in pairs (true/false)
*/
class GeometryUpdatesBlocker
{
public:
@ -544,16 +561,19 @@ class GeometryUpdatesBlocker
: cl( c ) { cl->blockGeometryUpdates( true ); }
~GeometryUpdatesBlocker()
{ cl->blockGeometryUpdates( false ); }
private:
Client* cl;
};
// NET WM Protocol handler class
/**
* NET WM Protocol handler class
*/
class WinInfo : public NETWinInfo2
{
private:
typedef KWin::Client Client; // because of NET::Client
typedef KWin::Client Client; // Because of NET::Client
public:
WinInfo( Client* c, Display * display, Window window,
Window rwin, const unsigned long pr[], int pr_size );
@ -561,6 +581,7 @@ class WinInfo : public NETWinInfo2
virtual void changeFullscreenMonitors(NETFullscreenMonitors topology);
virtual void changeState( unsigned long state, unsigned long mask );
void disable();
private:
Client * m_client;
};
@ -590,7 +611,7 @@ inline bool Client::groupTransient() const
return transient_for_id == rootWindow();
}
// needed because verifyTransientFor() may set transient_for_id to root window,
// Needed because verifyTransientFor() may set transient_for_id to root window,
// if the original value has a problem (window doesn't exist, etc.)
inline bool Client::wasOriginallyGroupTransient() const
{
@ -617,8 +638,7 @@ inline Group* Client::group()
return in_group;
}
inline
bool Client::isMinimized() const
inline bool Client::isMinimized() const
{
return minimized;
}
@ -628,26 +648,22 @@ inline bool Client::isActive() const
return active;
}
inline
bool Client::isShown( bool shaded_is_shown ) const
inline bool Client::isShown( bool shaded_is_shown ) const
{
return !isMinimized() && ( !isShade() || shaded_is_shown ) && !hidden;
}
inline
bool Client::isHiddenInternal() const
inline bool Client::isHiddenInternal() const
{
return hidden;
}
inline
bool Client::isShade() const
inline bool Client::isShade() const
{
return shade_mode == ShadeNormal;
}
inline
ShadeMode Client::shadeMode() const
inline ShadeMode Client::shadeMode() const
{
return shade_mode;
}

File diff suppressed because it is too large Load diff

View file

@ -39,6 +39,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <X11/Xlib.h>
// TODO: Cleanup the order of things in this .h file
class QMenu;
class KConfig;
class KActionCollection;
@ -92,7 +94,8 @@ class Workspace : public QObject, public KDecorationDefines
*/
void killWindowId( Window window);
void killWindow() { slotKillWindow(); }
void killWindow()
{ slotKillWindow(); }
bool initializing() const;
@ -101,23 +104,27 @@ class Workspace : public QObject, public KDecorationDefines
* if no client has the focus)
*/
Client* activeClient() const;
// Client that was activated, but it's not yet really activeClient(), because
// we didn't process yet the matching FocusIn event. Used mostly in focus
// stealing prevention code.
/**
* Client that was activated, but it's not yet really activeClient(), because
* we didn't process yet the matching FocusIn event. Used mostly in focus
* stealing prevention code.
*/
Client* mostRecentlyActivatedClient() const;
void activateClient( Client*, bool force = false );
void requestFocus( Client* c, bool force = false );
void takeActivity( Client* c, int flags, bool handled ); // flags are ActivityFlags
void handleTakeActivity( Client* c, Time timestamp, int flags ); // flags are ActivityFlags
bool allowClientActivation( const Client* c, Time time = -1U, bool focus_in = false, bool ignore_desktop = false );
void takeActivity( Client* c, int flags, bool handled ); // Flags are ActivityFlags
void handleTakeActivity( Client* c, Time timestamp, int flags ); // Flags are ActivityFlags
bool allowClientActivation( const Client* c, Time time = -1U, bool focus_in = false,
bool ignore_desktop = false );
void restoreFocus();
void gotFocusIn( const Client* );
void setShouldGetFocus( Client* );
bool fakeRequestedActivity( Client* c );
void unfakeActivity( Client* c );
bool activateNextClient( Client* c );
bool focusChangeEnabled() { return block_focus == 0; }
bool focusChangeEnabled()
{ return block_focus == 0; }
void updateColormap();
@ -172,7 +179,7 @@ class Workspace : public QObject, public KDecorationDefines
QRect screenGeometry( int screen ) const;
int screenNumber( const QPoint& pos ) const;
// for TabBox
// Tab box
Client* currentTabBoxClient() const;
ClientList currentTabBoxClientList() const;
int currentTabBoxDesktop() const;
@ -199,14 +206,15 @@ class Workspace : public QObject, public KDecorationDefines
ToplevelList xStackingOrder() const;
ClientList ensureStackingOrder( const ClientList& clients ) const;
Client* topClientOnDesktop( int desktop, int screen, bool unconstrained = false, bool only_normal = true ) const;
Client* topClientOnDesktop( int desktop, int screen, bool unconstrained = false,
bool only_normal = true ) const;
Client* findDesktop( bool topmost, int desktop ) const;
void sendClientToDesktop( Client* c, int desktop, bool dont_activate );
void windowToPreviousDesktop( Client* c );
void windowToNextDesktop( Client* c );
void sendClientToScreen( Client* c, int screen );
// 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 loadEffect( const QString& name );
@ -252,7 +260,7 @@ class Workspace : public QObject, public KDecorationDefines
double decorationShadowBrightness( ShadowType type ) const;
double decorationShadowSaturation( ShadowType type ) const;
// dcop interface
// D-Bus interface
void cascadeDesktop();
void unclutterDesktop();
void doNotManage( const QString& );
@ -272,26 +280,31 @@ class Workspace : public QObject, public KDecorationDefines
void resetShowingDesktop( bool keep_hidden );
bool showingDesktop() const;
bool isNotManaged( const QString& title ); // ### setter or getter ?
bool isNotManaged( const QString& title ); // TODO: Setter or getter?
void sendPingToWindow( Window w, Time timestamp ); // called from Client::pingWindow()
void sendTakeActivity( Client* c, Time timestamp, long flags ); // called from Client::takeActivity()
void sendPingToWindow( Window w, Time timestamp ); // Called from Client::pingWindow()
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()
void removeClient( Client*, allowed_t ); // Only called from Client::destroyClient() or Client::releaseWindow()
void setActiveClient( Client*, allowed_t );
Group* findGroup( Window leader ) const;
void addGroup( Group* group, allowed_t );
void removeGroup( Group* group, allowed_t );
Group* findClientLeaderGroup( const Client* c ) const;
void removeUnmanaged( Unmanaged*, allowed_t ); // only called from Unmanaged::release()
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 );
void focusToNull(); // SELI public?
enum FocusChainChange { FocusChainMakeFirst, FocusChainMakeLast, FocusChainUpdate };
void focusToNull(); // SELI TODO: Public?
enum FocusChainChange
{
FocusChainMakeFirst,
FocusChainMakeLast,
FocusChainUpdate
};
void updateFocusChains( Client* c, FocusChainChange change );
bool forcedGlobalMouseGrab() const;
@ -331,14 +344,14 @@ class Workspace : public QObject, public KDecorationDefines
void addRepaint( const QRect& r );
void addRepaint( const QRegion& r );
void addRepaint( int x, int y, int w, int h );
// creates XComposite overlay window, call initOverlay() afterwards
/// Creates XComposite overlay window, call initOverlay() afterwards
bool createOverlay();
// init overlay and the destination window in it
/// Init overlay and the destination window in it
void setupOverlay( Window window );
void showOverlay();
void hideOverlay(); // hides and resets overlay window
void setOverlayShape( const QRegion& reg );
// destroys XComposite overlay window
/// Destroys XComposite overlay window
void destroyOverlay();
Window overlayWindow();
void checkUnredirect( bool force = false );
@ -347,7 +360,8 @@ class Workspace : public QObject, public KDecorationDefines
public slots:
void addRepaintFull();
void refresh();
// keybindings
// Keybindings
void slotSwitchDesktopNext();
void slotSwitchDesktopPrevious();
void slotSwitchDesktopRight();
@ -534,7 +548,7 @@ class Workspace : public QObject, public KDecorationDefines
bool establishTabBoxGrab();
void removeTabBoxGrab();
void propagateClients( bool propagate_new_clients ); // called only from updateStackingOrder
void propagateClients( bool propagate_new_clients ); // Called only from updateStackingOrder
ClientList constrainedStackingOrder();
void raiseClientWithinApplication( Client* c );
void lowerClientWithinApplication( Client* c );
@ -547,7 +561,7 @@ class Workspace : public QObject, public KDecorationDefines
void updateTopMenuGeometry( Client* c = NULL );
void updateToolWindows( bool also_hide );
// 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 );
void addClient( Client* c, allowed_t );
Unmanaged* createUnmanaged( Window w );
@ -559,11 +573,11 @@ class Workspace : public QObject, public KDecorationDefines
void smartPlacement( Client* c );
void cascadePlacement( Client* c, bool re_init = false );
// desktop names and number of desktops
// Desktop names and number of desktops
void loadDesktopSettings();
void saveDesktopSettings();
// mouse emulation
// Mouse emulation
WId getMouseEmulationWindow();
enum MouseEmulation { EmuPress, EmuRelease, EmuMove };
unsigned int sendFakedMouseEvent( const QPoint& pos, WId win, MouseEmulation type, int button, unsigned int state ); // returns the new state
@ -571,12 +585,12 @@ class Workspace : public QObject, public KDecorationDefines
void tabBoxKeyPress( int key );
void tabBoxKeyRelease( const XKeyEvent& ev );
// electric borders
// Electric borders
void destroyElectricBorders();
bool electricBorderEvent(XEvent * e);
void electricBorderSwitchDesktop( ElectricBorder border, const QPoint& pos );
// ------------------
//---------------------------------------------------------------------
void helperDialog( const QString& message, const Client* c );
@ -612,12 +626,12 @@ class Workspace : public QObject, public KDecorationDefines
Client* active_client;
Client* last_active_client;
Client* most_recently_raised; // used _only_ by raiseOrLowerClient()
Client* most_recently_raised; // Used ONLY by raiseOrLowerClient()
Client* movingClient;
Client* pending_take_activity;
int active_screen;
// delay(ed) window focus timer and client
// Delay(ed) window focus timer and client
QTimer* delayFocusTimer;
Client* delayfocus_client;
QPoint focusMousePos;
@ -627,14 +641,14 @@ class Workspace : public QObject, public KDecorationDefines
UnmanagedList unmanaged;
DeletedList deleted;
ClientList unconstrained_stacking_order; // topmost last
ClientList stacking_order; // topmost last
ClientList unconstrained_stacking_order; // Topmost last
ClientList stacking_order; // Topmost last
bool force_restacking;
mutable ToplevelList x_stacking; // from XQueryTree()
mutable ToplevelList x_stacking; // From XQueryTree()
mutable bool x_stacking_dirty;
QVector< ClientList > focus_chain; // currently ative last
ClientList global_focus_chain; // this one is only for things like tabbox's MRU
ClientList should_get_focus; // last is most recent
QVector< ClientList > focus_chain; // Currently ative last
ClientList global_focus_chain; // This one is only for things like tabbox's MRU
ClientList should_get_focus; // Last is most recent
ClientList attention_chain;
bool showing_desktop;
@ -694,10 +708,10 @@ class Workspace : public QObject, public KDecorationDefines
RootInfo* rootInfo;
QWidget* supportWindow;
// swallowing
// Swallowing
QStringList doNotManageList;
// colormap handling
// Colormap handling
Colormap default_colormap;
Colormap installed_colormap;
@ -721,7 +735,7 @@ class Workspace : public QObject, public KDecorationDefines
Time electric_time_first;
Time electric_time_last;
QPoint electric_push_point;
int electric_reserved[ ELECTRIC_COUNT ]; // corners/edges used by something
int electric_reserved[ELECTRIC_COUNT]; // Corners/edges used by something
Qt::Orientation layoutOrientation;
int layoutX;
@ -729,19 +743,19 @@ class Workspace : public QObject, public KDecorationDefines
Placement* initPositioning;
QVector< QRect > workarea; // array of workareas for virtual desktops
QVector< QVector< QRect > > screenarea; // array of workareas per xinerama screen for all virtual desktops
QVector<QRect> workarea; // Array of workareas for virtual desktops
QVector< QVector<QRect> > screenarea; // Array of workareas per xinerama screen for all virtual desktops
bool managing_topmenus;
KSelectionOwner* topmenu_selection;
KSelectionWatcher* topmenu_watcher;
ClientList topmenus; // doesn't own them
ClientList topmenus; // Doesn't own them
mutable int topmenu_height;
QWidget* topmenu_space;
int set_active_client_recursion;
int block_stacking_updates; // when >0, stacking updates are temporarily disabled
bool blocked_propagating_new_clients; // propagate also new clients after enabling stacking updates?
int block_stacking_updates; // When > 0, stacking updates are temporarily disabled
bool blocked_propagating_new_clients; // Propagate also new clients after enabling stacking updates?
Window null_focus_window;
bool forced_global_mouse_grab;
friend class StackingUpdatesBlocker;
@ -755,7 +769,7 @@ class Workspace : public QObject, public KDecorationDefines
QRegion repaints_region;
Window overlay; // XComposite overlay window
bool overlay_visible;
bool overlay_shown; // for showOverlay()
bool overlay_shown; // For showOverlay()
QRegion overlay_shape;
QSlider* transSlider;
QPushButton* transButton;
@ -767,7 +781,9 @@ class Workspace : public QObject, public KDecorationDefines
friend bool performTransiencyCheck();
};
// helper for Workspace::blockStackingUpdates() being called in pairs (true/false)
/**
* Helper for Workspace::blockStackingUpdates() being called in pairs (True/false)
*/
class StackingUpdatesBlocker
{
public:
@ -775,17 +791,23 @@ class StackingUpdatesBlocker
: ws( w ) { ws->blockStackingUpdates( true ); }
~StackingUpdatesBlocker()
{ ws->blockStackingUpdates( false ); }
private:
Workspace* ws;
};
// NET WM Protocol handler class
/**
* NET WM Protocol handler class
*/
class RootInfo : public NETRootInfo
{
private:
typedef KWin::Client Client; // because of NET::Client
typedef KWin::Client Client; // Because of NET::Client
public:
RootInfo( Workspace* ws, Display *dpy, Window w, const char *name, unsigned long pr[], int pr_num, int scr= -1);
RootInfo( Workspace* ws, Display* dpy, Window w, const char* name, unsigned long pr[],
int pr_num, int scr= -1 );
protected:
virtual void changeNumberOfDesktops( int n );
virtual void changeCurrentDesktop( int d );
@ -797,6 +819,7 @@ class RootInfo : public NETRootInfo
virtual void restackWindow( Window w, RequestSource source, Window above, int detail, Time timestamp );
virtual void gotTakeActivity( Window w, Time timestamp, long flags );
virtual void changeShowingDesktop( bool showing );
private:
Workspace* workspace;
};
@ -839,7 +862,7 @@ inline void Workspace::removeGroup( Group* group, allowed_t )
inline const ClientList& Workspace::stackingOrder() const
{
// TODO Q_ASSERT( block_stacking_updates == 0 );
// TODO: Q_ASSERT( block_stacking_updates == 0 );
return stacking_order;
}
@ -853,20 +876,17 @@ inline void Workspace::showWindowMenu(int x, int y, Client* cl)
showWindowMenu( QRect( QPoint( x, y ), QPoint( x, y )), cl );
}
inline
void Workspace::setWasUserInteraction()
inline void Workspace::setWasUserInteraction()
{
was_user_interaction = true;
}
inline
bool Workspace::wasUserInteraction() const
inline bool Workspace::wasUserInteraction() const
{
return was_user_interaction;
}
inline
bool Workspace::managingTopMenus() const
inline bool Workspace::managingTopMenus() const
{
return managing_topmenus;
}
@ -906,27 +926,23 @@ inline Window Workspace::overlayWindow()
return overlay;
}
inline
bool Workspace::rulesUpdatesDisabled() const
inline bool Workspace::rulesUpdatesDisabled() const
{
return rules_updates_disabled;
}
inline
void Workspace::forceRestacking()
inline void Workspace::forceRestacking()
{
force_restacking = true;
StackingUpdatesBlocker blocker( this ); // do restacking if not blocked
StackingUpdatesBlocker blocker( this ); // Do restacking if not blocked
}
inline
void Workspace::updateFocusMousePosition( const QPoint& pos )
inline void Workspace::updateFocusMousePosition( const QPoint& pos )
{
focusMousePos = pos;
}
inline
QPoint Workspace::focusMousePosition() const
inline QPoint Workspace::focusMousePosition() const
{
return focusMousePos;
}
@ -979,66 +995,59 @@ inline void Workspace::forEachUnmanaged( T procedure )
}
KWIN_COMPARE_PREDICATE( ClientMatchPredicate, Client, const Client*, cl == value );
inline bool Workspace::hasClient( const Client* c )
{
return findClient( ClientMatchPredicate( c ));
}
inline
void Workspace::checkCompositeTimer()
inline void Workspace::checkCompositeTimer()
{
if( !compositeTimer.isActive() )
setCompositeTimer();
}
inline
bool Workspace::hasDecorationShadows() const
inline bool Workspace::hasDecorationShadows() const
{
return mgr->factory()->supports( AbilityCompositingShadow );
}
inline
QList< QList<QImage> > Workspace::decorationShadowTextures()
inline QList< QList<QImage> > Workspace::decorationShadowTextures()
{
if( KDecorationFactoryUnstable* factory = dynamic_cast<KDecorationFactoryUnstable*>( mgr->factory() ))
return factory->shadowTextures();
return QList< QList<QImage> >();
}
inline
int Workspace::decorationShadowTextureList( ShadowType type ) const
inline int Workspace::decorationShadowTextureList( ShadowType type ) const
{
if( KDecorationFactoryUnstable* factory = dynamic_cast<KDecorationFactoryUnstable*>( mgr->factory() ))
return factory->shadowTextureList( type );
return -1;
}
inline
QList<QRect> Workspace::decorationShadowQuads( ShadowType type, QSize size ) const
inline QList<QRect> Workspace::decorationShadowQuads( ShadowType type, QSize size ) const
{
if( KDecorationFactoryUnstable* factory = dynamic_cast<KDecorationFactoryUnstable*>( mgr->factory() ))
return factory->shadowQuads( type, size );
return QList<QRect>();
}
inline
double Workspace::decorationShadowOpacity( ShadowType type ) const
inline double Workspace::decorationShadowOpacity( ShadowType type ) const
{
if( KDecorationFactoryUnstable* factory = dynamic_cast<KDecorationFactoryUnstable*>( mgr->factory() ))
return factory->shadowOpacity( type );
return 1.0;
}
inline
double Workspace::decorationShadowBrightness( ShadowType type ) const
inline double Workspace::decorationShadowBrightness( ShadowType type ) const
{
if( KDecorationFactoryUnstable* factory = dynamic_cast<KDecorationFactoryUnstable*>( mgr->factory() ))
return factory->shadowBrightness( type );
return 1.0;
}
inline
double Workspace::decorationShadowSaturation( ShadowType type ) const
inline double Workspace::decorationShadowSaturation( ShadowType type ) const
{
if( KDecorationFactoryUnstable* factory = dynamic_cast< KDecorationFactoryUnstable*>( mgr->factory() ))
return factory->shadowSaturation( type );