2000-03-24 22:23:02 +00:00
|
|
|
/*****************************************************************
|
|
|
|
kwin - the KDE window manager
|
2000-04-06 18:29:04 +00:00
|
|
|
|
2000-03-24 22:23:02 +00:00
|
|
|
Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
|
|
|
******************************************************************/
|
1999-08-19 23:26:42 +00:00
|
|
|
#ifndef WORKSPACE_H
|
|
|
|
#define WORKSPACE_H
|
|
|
|
|
|
|
|
#include <qwidget.h>
|
|
|
|
#include <qapplication.h>
|
|
|
|
#include <qpopupmenu.h>
|
1999-11-22 01:57:51 +00:00
|
|
|
#include <qguardedptr.h>
|
1999-08-19 23:26:42 +00:00
|
|
|
#include <qvaluelist.h>
|
2001-09-11 06:53:46 +00:00
|
|
|
#include <qptrlist.h>
|
2001-01-25 19:17:17 +00:00
|
|
|
#include <qtimer.h>
|
2001-05-12 00:33:43 +00:00
|
|
|
#include <config.h>
|
1999-11-29 02:06:41 +00:00
|
|
|
#include "options.h"
|
2000-05-04 23:12:29 +00:00
|
|
|
#include "KWinInterface.h"
|
2001-12-29 04:19:24 +00:00
|
|
|
#include <kshortcut.h>
|
2000-05-04 23:12:29 +00:00
|
|
|
|
2000-06-08 17:05:51 +00:00
|
|
|
#include <X11/Xlib.h>
|
2001-05-12 00:33:43 +00:00
|
|
|
#ifdef HAVE_XINERAMA
|
2002-01-16 11:13:17 +00:00
|
|
|
# ifndef Bool
|
|
|
|
// if Bool isn't defined, then the Xinerama header will have problems...
|
|
|
|
# define Bool int
|
|
|
|
# endif
|
2001-05-12 00:33:43 +00:00
|
|
|
extern "C" {
|
|
|
|
#include <X11/extensions/Xinerama.h>
|
|
|
|
};
|
|
|
|
#endif
|
2000-06-08 17:05:51 +00:00
|
|
|
|
2001-02-20 01:20:38 +00:00
|
|
|
class KConfig;
|
|
|
|
class KGlobalAccel;
|
|
|
|
|
|
|
|
namespace KWinInternal {
|
2000-06-08 17:05:51 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
class Client;
|
|
|
|
class TabBox;
|
2000-06-08 17:05:51 +00:00
|
|
|
class RootInfo;
|
2001-02-20 01:20:38 +00:00
|
|
|
class PluginMgr;
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
typedef QValueList<Client*> ClientList;
|
1999-11-14 06:34:28 +00:00
|
|
|
|
2000-06-28 07:51:45 +00:00
|
|
|
class SystemTrayWindow
|
1999-11-14 06:34:28 +00:00
|
|
|
{
|
|
|
|
public:
|
2000-06-28 07:51:45 +00:00
|
|
|
SystemTrayWindow()
|
|
|
|
: win(0),winFor(0)
|
1999-11-14 06:34:28 +00:00
|
|
|
{}
|
2000-06-28 07:51:45 +00:00
|
|
|
SystemTrayWindow( WId w )
|
|
|
|
: win(w),winFor(0)
|
1999-11-14 06:34:28 +00:00
|
|
|
{}
|
2000-06-28 07:51:45 +00:00
|
|
|
SystemTrayWindow( WId w, WId wf )
|
|
|
|
: win(w),winFor(wf)
|
1999-11-14 06:34:28 +00:00
|
|
|
{}
|
1999-11-15 00:52:05 +00:00
|
|
|
|
2000-06-28 07:51:45 +00:00
|
|
|
bool operator==( const SystemTrayWindow& other )
|
|
|
|
{ return win == other.win; }
|
|
|
|
WId win;
|
|
|
|
WId winFor;
|
1999-11-14 06:34:28 +00:00
|
|
|
};
|
|
|
|
|
2000-06-28 07:51:45 +00:00
|
|
|
typedef QValueList<SystemTrayWindow> SystemTrayWindowList;
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2001-04-20 07:19:03 +00:00
|
|
|
struct SessionInfoPrivate;
|
2000-03-24 22:23:02 +00:00
|
|
|
struct SessionInfo
|
|
|
|
{
|
|
|
|
QCString sessionId;
|
|
|
|
QCString windowRole;
|
2001-03-19 15:35:07 +00:00
|
|
|
QCString wmCommand;
|
|
|
|
QCString wmClientMachine;
|
|
|
|
QCString resourceName;
|
2001-01-14 20:16:04 +00:00
|
|
|
QCString resourceClass;
|
|
|
|
|
2000-08-30 14:27:30 +00:00
|
|
|
QRect geometry;
|
|
|
|
QRect restore;
|
|
|
|
int maximize;
|
2000-03-24 22:23:02 +00:00
|
|
|
int desktop;
|
|
|
|
bool iconified;
|
|
|
|
bool sticky;
|
2000-08-30 14:27:30 +00:00
|
|
|
bool shaded;
|
|
|
|
bool staysOnTop;
|
2001-03-12 21:32:13 +00:00
|
|
|
bool skipTaskbar;
|
2001-05-02 20:37:30 +00:00
|
|
|
bool skipPager;
|
2001-04-20 07:19:03 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SessionInfoPrivate* d;
|
2000-03-24 22:23:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
1999-11-12 03:11:19 +00:00
|
|
|
class Shape {
|
|
|
|
public:
|
|
|
|
static bool hasShape( WId w);
|
|
|
|
static int shapeEvent();
|
|
|
|
};
|
|
|
|
|
2000-04-06 18:29:04 +00:00
|
|
|
class Motif {
|
|
|
|
public:
|
|
|
|
static bool noBorder( WId w );
|
|
|
|
};
|
|
|
|
|
2001-04-03 14:40:34 +00:00
|
|
|
class WorkspacePrivate;
|
2001-06-13 15:47:54 +00:00
|
|
|
// NOTE: this class has to keep binary compatibility, just like other
|
|
|
|
// KWin classes accessible from the plugins
|
2001-04-03 14:40:34 +00:00
|
|
|
|
2000-05-04 23:12:29 +00:00
|
|
|
class Workspace : public QObject, virtual public KWinInterface
|
1999-08-19 23:26:42 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2000-03-24 22:23:02 +00:00
|
|
|
Workspace( bool restore = FALSE );
|
1999-08-19 23:26:42 +00:00
|
|
|
virtual ~Workspace();
|
|
|
|
|
2001-04-22 06:51:07 +00:00
|
|
|
static Workspace * self() { return _self; }
|
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
virtual bool workspaceEvent( XEvent * );
|
|
|
|
|
1999-11-07 08:46:36 +00:00
|
|
|
bool hasClient(Client *);
|
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
Client* findClient( WId w ) const;
|
|
|
|
|
|
|
|
QRect geometry() const;
|
2000-05-26 13:54:50 +00:00
|
|
|
|
2001-06-03 09:04:03 +00:00
|
|
|
enum clientAreaOption { PlacementArea, MovementArea, MaximizeArea };
|
|
|
|
|
2001-06-03 09:30:19 +00:00
|
|
|
|
|
|
|
// default is MaximizeArea
|
|
|
|
QRect clientArea(); // ### KDE3: remove me!
|
|
|
|
QRect clientArea(clientAreaOption);
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2001-03-14 09:21:16 +00:00
|
|
|
void removeClient( Client* );
|
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
bool destroyClient( Client* );
|
|
|
|
|
2000-05-17 23:02:42 +00:00
|
|
|
void killWindowAtPosition(int x, int y);
|
|
|
|
|
2000-09-23 14:48:02 +00:00
|
|
|
void killWindow() { slotKillWindow(); }
|
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
WId rootWin() const;
|
|
|
|
|
2000-05-04 23:12:29 +00:00
|
|
|
/**
|
|
|
|
* Returns the active client, i.e. the client that has the focus (or None
|
|
|
|
* if no client has the focus)
|
|
|
|
*/
|
1999-08-19 23:26:42 +00:00
|
|
|
Client* activeClient() const;
|
2000-05-04 23:12:29 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
void setActiveClient( Client* );
|
2000-09-11 20:54:00 +00:00
|
|
|
void activateClient( Client*, bool force = FALSE );
|
|
|
|
void requestFocus( Client* c, bool force = FALSE );
|
|
|
|
|
2000-08-30 14:27:30 +00:00
|
|
|
void updateColormap();
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2001-08-27 23:56:15 +00:00
|
|
|
void setFocusChangeEnabled(bool b) { focus_change = b; } // KDE 3.0: No longer used
|
|
|
|
bool focusChangeEnabled() { return focus_change; } // KDE 3.0: No longer used
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates that the client c is being moved around by the user.
|
2002-01-19 04:55:32 +00:00
|
|
|
*/
|
2001-08-27 23:56:15 +00:00
|
|
|
void setClientIsMoving( Client *c );
|
2000-06-02 00:20:41 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
void doPlacement( Client* c );
|
1999-11-25 16:38:11 +00:00
|
|
|
QPoint adjustClientPosition( Client* c, QPoint pos );
|
1999-08-19 23:26:42 +00:00
|
|
|
void raiseClient( Client* c );
|
2000-10-02 12:02:15 +00:00
|
|
|
void lowerClient( Client* c );
|
2001-04-02 16:17:06 +00:00
|
|
|
void raiseOrLowerClient( Client * );
|
2001-06-04 14:01:00 +00:00
|
|
|
void reconfigure();
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
void clientHidden( Client* );
|
2001-06-18 20:18:32 +00:00
|
|
|
|
2001-04-02 22:12:54 +00:00
|
|
|
void clientReady( Client* );
|
2001-11-03 00:05:33 +00:00
|
|
|
void clientMoved(const QPoint &pos, unsigned long time);
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2000-05-04 23:12:29 +00:00
|
|
|
/**
|
|
|
|
* Returns the current virtual desktop of this workspace
|
|
|
|
*/
|
1999-08-19 23:26:42 +00:00
|
|
|
int currentDesktop() const;
|
2001-06-10 04:10:42 +00:00
|
|
|
int nextDesktop( int iDesktop ) const;
|
|
|
|
int previousDesktop( int iDesktop ) const;
|
2000-05-04 23:12:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the number of virtual desktops of this workspace
|
|
|
|
*/
|
1999-08-19 23:26:42 +00:00
|
|
|
int numberOfDesktops() const;
|
1999-11-07 01:43:06 +00:00
|
|
|
void setNumberOfDesktops( int n );
|
|
|
|
|
1999-09-27 16:02:44 +00:00
|
|
|
QWidget* desktopWidget();
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
Client* nextClient(Client*) const;
|
|
|
|
Client* previousClient(Client*) const;
|
|
|
|
Client* nextStaticClient(Client*) const;
|
|
|
|
Client* previousStaticClient(Client*) const;
|
2000-07-11 11:41:52 +00:00
|
|
|
|
2000-06-28 13:20:42 +00:00
|
|
|
/**
|
2000-05-04 23:12:29 +00:00
|
|
|
* Returns the list of clients sorted in stacking order, with topmost client
|
|
|
|
* at the last position
|
|
|
|
*/
|
2000-05-03 00:04:26 +00:00
|
|
|
const ClientList& stackingOrder() const;
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2000-06-22 18:08:35 +00:00
|
|
|
Client* topClientOnDesktop() const;
|
2000-06-23 18:56:59 +00:00
|
|
|
void sendClientToDesktop( Client* c, int desktop );
|
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
|
1999-11-22 01:57:51 +00:00
|
|
|
QPopupMenu* clientPopup( Client* );
|
2000-11-12 20:25:21 +00:00
|
|
|
void showWindowMenuAt( unsigned long id, int x, int y );
|
1999-11-25 16:38:11 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
void setDesktopClient( Client* );
|
|
|
|
|
1999-11-28 20:10:58 +00:00
|
|
|
void iconifyOrDeiconifyTransientsOf( Client* );
|
2000-01-10 03:47:30 +00:00
|
|
|
void setStickyTransientsOf( Client*, bool sticky );
|
1999-12-06 00:43:55 +00:00
|
|
|
|
1999-11-28 20:55:52 +00:00
|
|
|
bool hasCaption( const QString& caption );
|
1999-11-14 06:34:28 +00:00
|
|
|
|
1999-11-29 02:06:41 +00:00
|
|
|
void performWindowOperation( Client* c, Options::WindowOperation op );
|
|
|
|
|
2001-03-19 15:35:07 +00:00
|
|
|
void restoreLegacySession( KConfig* config );
|
|
|
|
void storeLegacySession( KConfig* config );
|
2000-03-24 22:23:02 +00:00
|
|
|
void storeSession( KConfig* config );
|
2000-04-06 18:29:04 +00:00
|
|
|
|
2000-03-24 22:23:02 +00:00
|
|
|
SessionInfo* takeSessionInfo( Client* );
|
2000-05-26 13:54:50 +00:00
|
|
|
|
2000-05-04 23:12:29 +00:00
|
|
|
virtual void updateClientArea();
|
2000-05-26 13:54:50 +00:00
|
|
|
|
2000-06-21 17:43:44 +00:00
|
|
|
|
2000-06-08 17:05:51 +00:00
|
|
|
// dcop interface
|
|
|
|
void cascadeDesktop();
|
|
|
|
void unclutterDesktop();
|
2000-07-15 01:12:41 +00:00
|
|
|
void doNotManage(QString);
|
2001-03-08 14:28:07 +00:00
|
|
|
void setCurrentDesktop( int new_desktop );
|
2001-06-09 05:00:46 +00:00
|
|
|
void nextDesktop();
|
|
|
|
void previousDesktop();
|
2000-07-30 16:15:17 +00:00
|
|
|
|
2000-07-14 19:56:47 +00:00
|
|
|
QString desktopName( int desk );
|
2001-11-29 23:59:54 +00:00
|
|
|
void setDesktopLayout(int o, int x, int y);
|
2000-07-30 16:15:17 +00:00
|
|
|
|
2000-07-15 01:12:41 +00:00
|
|
|
bool isNotManaged( const QString& title );
|
1999-11-29 02:06:41 +00:00
|
|
|
|
1999-11-14 06:34:28 +00:00
|
|
|
public slots:
|
2001-03-14 10:16:08 +00:00
|
|
|
void refresh();
|
1999-11-13 01:51:22 +00:00
|
|
|
// keybindings
|
2001-01-11 23:41:07 +00:00
|
|
|
void slotSwitchDesktopNext();
|
|
|
|
void slotSwitchDesktopPrevious();
|
2000-07-04 17:07:58 +00:00
|
|
|
void slotSwitchDesktopRight();
|
|
|
|
void slotSwitchDesktopLeft();
|
2001-01-11 23:41:07 +00:00
|
|
|
void slotSwitchDesktopUp();
|
|
|
|
void slotSwitchDesktopDown();
|
1999-11-25 16:38:11 +00:00
|
|
|
|
2001-06-10 04:10:42 +00:00
|
|
|
void slotSwitchToDesktop( int );
|
|
|
|
//void slotSwitchToWindow( int );
|
|
|
|
void slotWindowToDesktop( int );
|
|
|
|
//void slotWindowToListPosition( int );
|
|
|
|
|
1999-11-29 02:18:29 +00:00
|
|
|
void slotWindowMaximize();
|
|
|
|
void slotWindowMaximizeVertical();
|
|
|
|
void slotWindowMaximizeHorizontal();
|
|
|
|
void slotWindowIconify();
|
2001-06-07 18:17:24 +00:00
|
|
|
void slotWindowIconifyAll();
|
1999-11-29 02:49:20 +00:00
|
|
|
void slotWindowShade();
|
2000-07-30 16:15:17 +00:00
|
|
|
void slotWindowRaise();
|
|
|
|
void slotWindowLower();
|
2001-04-02 16:17:06 +00:00
|
|
|
void slotWindowRaiseOrLower();
|
1999-11-29 02:18:29 +00:00
|
|
|
|
2001-03-19 20:05:36 +00:00
|
|
|
void slotWalkThroughDesktops();
|
|
|
|
void slotWalkBackThroughDesktops();
|
2001-06-10 04:10:42 +00:00
|
|
|
void slotWalkThroughDesktopList();
|
|
|
|
void slotWalkBackThroughDesktopList();
|
2001-03-19 20:05:36 +00:00
|
|
|
void slotWalkThroughWindows();
|
|
|
|
void slotWalkBackThroughWindows();
|
|
|
|
|
1999-11-22 01:57:51 +00:00
|
|
|
void slotWindowOperations();
|
|
|
|
void slotWindowClose();
|
1999-12-06 00:43:55 +00:00
|
|
|
void slotWindowMove();
|
|
|
|
void slotWindowResize();
|
|
|
|
|
2002-01-19 04:55:32 +00:00
|
|
|
void slotWindowToNextDesktop();
|
|
|
|
void slotWindowToPreviousDesktop();
|
2001-05-11 21:38:00 +00:00
|
|
|
|
1999-12-06 00:43:55 +00:00
|
|
|
void slotMouseEmulation();
|
1999-11-25 16:38:11 +00:00
|
|
|
|
2001-01-25 19:17:17 +00:00
|
|
|
void slotResetAllClientsDelayed();
|
1999-12-24 01:36:47 +00:00
|
|
|
void slotResetAllClients();
|
2001-11-30 08:04:17 +00:00
|
|
|
void slotSettingsChanged( int category );
|
1999-12-24 01:36:47 +00:00
|
|
|
|
2001-06-04 14:01:00 +00:00
|
|
|
void slotReconfigure();
|
|
|
|
|
2000-05-17 23:02:42 +00:00
|
|
|
void slotKillWindow();
|
|
|
|
|
2001-06-26 23:30:52 +00:00
|
|
|
void slotGrabWindow();
|
|
|
|
void slotGrabDesktop();
|
|
|
|
|
1999-11-22 01:57:51 +00:00
|
|
|
private slots:
|
|
|
|
void desktopPopupAboutToShow();
|
|
|
|
void clientPopupAboutToShow();
|
|
|
|
void sendToDesktop( int );
|
|
|
|
void clientPopupActivated( int );
|
2001-05-10 17:54:57 +00:00
|
|
|
void configureWM();
|
2001-02-03 12:30:46 +00:00
|
|
|
void focusEnsurance();
|
2001-02-21 18:29:24 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
protected:
|
2002-01-19 04:55:32 +00:00
|
|
|
bool keyPress( XKeyEvent& ev );
|
|
|
|
bool keyRelease( XKeyEvent& ev );
|
|
|
|
bool keyPressMouseEmulation( XKeyEvent& ev );
|
2000-06-08 17:05:51 +00:00
|
|
|
bool netCheck( XEvent* e );
|
2001-05-24 21:01:09 +00:00
|
|
|
void checkStartOnDesktop( WId w );
|
2000-03-22 12:36:07 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
private:
|
|
|
|
void init();
|
2002-01-19 04:55:32 +00:00
|
|
|
void initShortcuts();
|
|
|
|
void readShortcuts();
|
2001-03-28 12:44:31 +00:00
|
|
|
|
|
|
|
bool startKDEWalkThroughWindows();
|
2001-06-10 04:10:42 +00:00
|
|
|
bool startWalkThroughDesktops( int mode ); // TabBox::Mode::DesktopMode | DesktopListMode
|
2001-03-28 12:44:31 +00:00
|
|
|
bool startWalkThroughDesktops();
|
2001-06-10 04:10:42 +00:00
|
|
|
bool startWalkThroughDesktopList();
|
2001-03-19 20:05:36 +00:00
|
|
|
void KDEWalkThroughWindows( bool forward );
|
|
|
|
void CDEWalkThroughWindows( bool forward );
|
|
|
|
void walkThroughDesktops( bool forward );
|
|
|
|
void KDEOneStepThroughWindows( bool forward );
|
2001-06-10 04:10:42 +00:00
|
|
|
void oneStepThroughDesktops( bool forward, int mode ); // TabBox::Mode::DesktopMode | DesktopListMode
|
2001-03-19 20:05:36 +00:00
|
|
|
void oneStepThroughDesktops( bool forward );
|
2001-06-10 04:10:42 +00:00
|
|
|
void oneStepThroughDesktopList( bool forward );
|
2000-07-11 11:41:52 +00:00
|
|
|
|
2000-06-28 13:20:42 +00:00
|
|
|
ClientList constrainedStackingOrder( const ClientList& list );
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2000-06-22 14:12:13 +00:00
|
|
|
Client* clientFactory(WId w);
|
2000-06-23 18:56:59 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
void raiseTransientsOf( ClientList& safeset, Client* c );
|
2000-05-03 06:30:37 +00:00
|
|
|
void lowerTransientsOf( ClientList& safeset, Client* c );
|
1999-08-19 23:26:42 +00:00
|
|
|
void randomPlacement(Client* c);
|
1999-11-16 08:53:02 +00:00
|
|
|
void smartPlacement(Client* c);
|
1999-11-20 06:27:07 +00:00
|
|
|
void cascadePlacement(Client* c, bool re_init = false);
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
void focusToNull();
|
|
|
|
|
2000-05-04 23:12:29 +00:00
|
|
|
Client* findClientWidthId( WId w ) const;
|
1999-09-27 16:02:44 +00:00
|
|
|
|
1999-11-07 01:43:06 +00:00
|
|
|
void propagateClients( bool onlyStacking = FALSE);
|
1999-11-12 03:11:19 +00:00
|
|
|
|
2000-06-28 07:51:45 +00:00
|
|
|
bool addSystemTrayWin( WId w );
|
|
|
|
bool removeSystemTrayWin( WId w );
|
|
|
|
void propagateSystemTrayWins();
|
|
|
|
SystemTrayWindow findSystemTrayWin( WId w );
|
1999-12-06 00:43:55 +00:00
|
|
|
|
1999-11-20 06:27:07 +00:00
|
|
|
//CT needed for cascading+
|
|
|
|
struct CascadingInfo {
|
|
|
|
QPoint pos;
|
|
|
|
int col;
|
|
|
|
int row;
|
|
|
|
};
|
2000-06-22 14:12:13 +00:00
|
|
|
|
2000-07-12 18:08:24 +00:00
|
|
|
// desktop names and number of desktops
|
|
|
|
void loadDesktopSettings();
|
|
|
|
void saveDesktopSettings();
|
2000-07-14 19:56:47 +00:00
|
|
|
|
2000-06-21 17:43:44 +00:00
|
|
|
// mouse emulation
|
|
|
|
WId getMouseEmulationWindow();
|
|
|
|
enum MouseEmulation { EmuPress, EmuRelease, EmuMove };
|
|
|
|
unsigned int sendFakedMouseEvent( QPoint pos, WId win, MouseEmulation type, int button, unsigned int state ); // returns the new state
|
2000-05-04 23:12:29 +00:00
|
|
|
|
2001-08-27 05:42:32 +00:00
|
|
|
// electric borders
|
|
|
|
void createBorderWindows();
|
|
|
|
void destroyBorderWindows();
|
|
|
|
void electricBorder(XEvent * e);
|
|
|
|
void raiseElectricBorders();
|
|
|
|
|
2000-05-04 23:12:29 +00:00
|
|
|
// ------------------
|
|
|
|
|
2001-11-29 23:59:54 +00:00
|
|
|
void calcDesktopLayout(int &x, int &y);
|
|
|
|
|
|
|
|
|
2000-06-28 07:51:45 +00:00
|
|
|
SystemTrayWindowList systemTrayWins;
|
2000-05-04 23:12:29 +00:00
|
|
|
|
|
|
|
int current_desktop;
|
|
|
|
int number_of_desktops;
|
2001-09-11 06:53:46 +00:00
|
|
|
QMemArray<int> desktop_focus_chain;
|
2000-05-04 23:12:29 +00:00
|
|
|
|
|
|
|
QGuardedPtr<Client> popup_client;
|
|
|
|
|
|
|
|
void loadSessionInfo();
|
2000-05-26 13:54:50 +00:00
|
|
|
|
2000-05-04 23:12:29 +00:00
|
|
|
QWidget* desktop_widget;
|
|
|
|
|
2001-09-11 06:53:46 +00:00
|
|
|
QPtrList<SessionInfo> session;
|
|
|
|
QPtrList<SessionInfo> fakeSession;
|
2001-01-14 20:16:04 +00:00
|
|
|
void loadFakeSessionInfo();
|
|
|
|
void storeFakeSessionInfo( Client* c );
|
|
|
|
void writeFakeSessionInfo();
|
1999-11-20 06:27:07 +00:00
|
|
|
QValueList<CascadingInfo> cci;
|
2000-05-04 23:12:29 +00:00
|
|
|
|
|
|
|
Client* desktop_client;
|
|
|
|
Client* active_client;
|
2001-02-03 12:30:46 +00:00
|
|
|
Client* last_active_client;
|
2000-05-04 23:12:29 +00:00
|
|
|
Client* should_get_focus;
|
2000-10-02 12:02:15 +00:00
|
|
|
Client* most_recently_raised;
|
2000-05-26 13:54:50 +00:00
|
|
|
|
2000-05-04 23:12:29 +00:00
|
|
|
ClientList clients;
|
|
|
|
ClientList stacking_order;
|
|
|
|
ClientList focus_chain;
|
|
|
|
|
|
|
|
bool control_grab;
|
|
|
|
bool tab_grab;
|
2002-01-19 04:55:32 +00:00
|
|
|
//KKeyNative walkThroughDesktopsKeycode, walkBackThroughDesktopsKeycode;
|
|
|
|
//KKeyNative walkThroughDesktopListKeycode, walkBackThroughDesktopListKeycode;
|
|
|
|
//KKeyNative walkThroughWindowsKeycode, walkBackThroughWindowsKeycode;
|
|
|
|
KShortcut cutWalkThroughDesktops, cutWalkThroughDesktopsReverse;
|
|
|
|
KShortcut cutWalkThroughDesktopList, cutWalkThroughDesktopListReverse;
|
|
|
|
KShortcut cutWalkThroughWindows, cutWalkThroughWindowsReverse;
|
2000-05-04 23:12:29 +00:00
|
|
|
bool mouse_emulation;
|
2000-06-21 17:43:44 +00:00
|
|
|
unsigned int mouse_emulation_state;
|
|
|
|
WId mouse_emulation_window;
|
2000-06-02 00:20:41 +00:00
|
|
|
bool focus_change;
|
2000-05-04 23:12:29 +00:00
|
|
|
|
|
|
|
TabBox* tab_box;
|
|
|
|
|
|
|
|
QPopupMenu *popup;
|
|
|
|
QPopupMenu *desk_popup;
|
|
|
|
|
|
|
|
KGlobalAccel *keys;
|
|
|
|
WId root;
|
|
|
|
|
2001-02-20 01:20:38 +00:00
|
|
|
PluginMgr *mgr;
|
2000-06-21 17:43:44 +00:00
|
|
|
|
2000-06-08 17:05:51 +00:00
|
|
|
RootInfo *rootInfo;
|
|
|
|
QWidget* supportWindow;
|
Preliminary support for avoiding covering clients such as kicker
which want to be permanently visible.
I've used an XAtom called '_NET_AVOID_SPEC'. This of course can change
if need be. I think it's correct according to the wm spec, but the
wm spec seems to be empty on gnome.org, so who knows.
Windows can choose to be avoided by setting an XTextProperty
with one value, which can be either 'N', 'S', 'E', or 'W', according
to which screen edge they are anchored to.
kwin then sets its 'clientArea' rect appropriately, so that (in
theory at least) clients will not enter this area in some circumstances,
such as when being mapped for the first time.
You can see that this actually works if you start lots of konsoles. They
don't appear over the panel. I don't know what happens if you move the
panel, but I presume things will be screwed up, because I haven't
looked at that yet.
If you maximise a window, it'll still fill the screen, because the
implementation of maximise in kwin/client.cpp doesn't take account
of the workspace's clientArea rect. This is easy to fix, but I've
been awake for too long, so I'll do it after 42 winks.
svn path=/trunk/kdebase/kwin/; revision=46772
2000-04-16 09:06:03 +00:00
|
|
|
|
2000-06-08 17:05:51 +00:00
|
|
|
QRect area;
|
2000-07-30 16:15:17 +00:00
|
|
|
|
2000-07-15 01:12:41 +00:00
|
|
|
// swallowing
|
|
|
|
QStringList doNotManageList;
|
2000-09-11 20:54:00 +00:00
|
|
|
|
2000-08-30 14:27:30 +00:00
|
|
|
// colormap handling
|
|
|
|
Colormap default_colormap;
|
|
|
|
Colormap installed_colormap;
|
2001-02-03 12:30:46 +00:00
|
|
|
|
2001-01-25 19:17:17 +00:00
|
|
|
// Timer to collect requests for 'ResetAllClients'
|
|
|
|
QTimer resetTimer;
|
2001-02-21 18:29:24 +00:00
|
|
|
|
2001-06-04 14:01:00 +00:00
|
|
|
// Timer to collect requests for 'reconfigure'
|
|
|
|
QTimer reconfigureTimer;
|
|
|
|
|
2001-02-03 12:30:46 +00:00
|
|
|
QTimer focusEnsuranceTimer;
|
2001-06-18 20:18:32 +00:00
|
|
|
|
2001-04-03 14:40:34 +00:00
|
|
|
WorkspacePrivate* d;
|
2001-04-22 06:51:07 +00:00
|
|
|
static Workspace *_self;
|
2001-05-12 00:33:43 +00:00
|
|
|
#ifdef HAVE_XINERAMA
|
|
|
|
int numHeads;
|
|
|
|
XineramaScreenInfo *xineramaInfo;
|
|
|
|
XineramaScreenInfo dummy_xineramaInfo;
|
|
|
|
#endif
|
1999-08-19 23:26:42 +00:00
|
|
|
};
|
|
|
|
|
2000-05-05 18:53:37 +00:00
|
|
|
inline WId Workspace::rootWin() const
|
|
|
|
{
|
|
|
|
return root;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline Client* Workspace::activeClient() const
|
|
|
|
{
|
|
|
|
return active_client;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline int Workspace::currentDesktop() const
|
|
|
|
{
|
|
|
|
return current_desktop;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline int Workspace::numberOfDesktops() const
|
|
|
|
{
|
|
|
|
return number_of_desktops;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const ClientList& Workspace::stackingOrder() const
|
|
|
|
{
|
|
|
|
return stacking_order;
|
|
|
|
}
|
|
|
|
|
2001-02-20 01:20:38 +00:00
|
|
|
};
|
2000-06-28 13:20:42 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
#endif
|