tool window handling for the default style
visible dialogs for stays-on-top fullscreen windows (helps with Konqueror's dialogs) Fixed lock with Alt-Tab box plus accelerator svn path=/trunk/kdebase/kwin/; revision=65241
This commit is contained in:
parent
e0e632dfdf
commit
6dacbd0112
15 changed files with 176 additions and 84 deletions
41
client.cpp
41
client.cpp
|
@ -423,6 +423,7 @@ Client::Client( Workspace *ws, WId w, QWidget *parent, const char *name, WFlags
|
||||||
is_sticky = FALSE;
|
is_sticky = FALSE;
|
||||||
stays_on_top = FALSE;
|
stays_on_top = FALSE;
|
||||||
may_move = TRUE;
|
may_move = TRUE;
|
||||||
|
is_fullscreen = TRUE;
|
||||||
skip_taskbar = FALSE;
|
skip_taskbar = FALSE;
|
||||||
max_mode = MaximizeRestore;
|
max_mode = MaximizeRestore;
|
||||||
|
|
||||||
|
@ -497,8 +498,10 @@ bool Client::manage( bool isMapped, bool doNotShow, bool isInitial )
|
||||||
|
|
||||||
QRect area = workspace()->clientArea();
|
QRect area = workspace()->clientArea();
|
||||||
|
|
||||||
if ( geom == workspace()->geometry() )
|
if ( geom == workspace()->geometry() ) {
|
||||||
|
is_fullscreen = TRUE;
|
||||||
may_move = FALSE; // don't let fullscreen windows be moved around
|
may_move = FALSE; // don't let fullscreen windows be moved around
|
||||||
|
}
|
||||||
|
|
||||||
if ( isMapped || session || isTransient() ) {
|
if ( isMapped || session || isTransient() ) {
|
||||||
placementDone = TRUE;
|
placementDone = TRUE;
|
||||||
|
@ -1144,9 +1147,19 @@ bool Client::isMaximizable() const
|
||||||
{
|
{
|
||||||
if ( isMaximized() )
|
if ( isMaximized() )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
return isResizable() && !isTransient();
|
return isResizable() && !isTransient() && !isTool();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Returns whether the window is minimizable or not
|
||||||
|
*/
|
||||||
|
bool Client::isMinimizable() const
|
||||||
|
{
|
||||||
|
return wantsTabFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Reimplemented to provide move/resize
|
Reimplemented to provide move/resize
|
||||||
|
@ -1516,7 +1529,7 @@ void Client::invalidateWindow()
|
||||||
*/
|
*/
|
||||||
void Client::iconify()
|
void Client::iconify()
|
||||||
{
|
{
|
||||||
if ( windowType() != NET::Normal && windowType() != NET::Toolbar ) // desktop and dock cannot be minimized
|
if ( !isMinimizable() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( isShade() )
|
if ( isShade() )
|
||||||
|
@ -1867,7 +1880,7 @@ void Client::setShade( bool s )
|
||||||
|
|
||||||
shaded = s;
|
shaded = s;
|
||||||
|
|
||||||
int as = options->animateShade? options->animSteps : 1;
|
int as = options->animateShade? 10 : 1;
|
||||||
|
|
||||||
if (shaded ) {
|
if (shaded ) {
|
||||||
int h = height();
|
int h = height();
|
||||||
|
@ -2406,6 +2419,12 @@ bool Client::wantsTabFocus() const
|
||||||
return (windowType() == NET::Normal || windowType() == NET::Override ) && ( input || Ptakefocus ) && !skip_taskbar;
|
return (windowType() == NET::Normal || windowType() == NET::Override ) && ( input || Ptakefocus ) && !skip_taskbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Client::wantsInput() const
|
||||||
|
{
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns whether the window is moveable or has a fixed
|
Returns whether the window is moveable or has a fixed
|
||||||
position. !isMovable implies !isResizable.
|
position. !isMovable implies !isResizable.
|
||||||
|
@ -2433,6 +2452,12 @@ bool Client::isMenu() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Client::isTool() const
|
||||||
|
{
|
||||||
|
return windowType() == NET::Tool;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns \a area with the client's strut taken into account.
|
Returns \a area with the client's strut taken into account.
|
||||||
|
@ -2465,9 +2490,13 @@ void Client::animateIconifyOrDeiconify( bool iconify)
|
||||||
|
|
||||||
float lf,rf,tf,bf,step;
|
float lf,rf,tf,bf,step;
|
||||||
|
|
||||||
int options_dot_ResizeAnimation = 1;
|
int speed = options->animateMinimizeSpeed;
|
||||||
|
if ( speed > 10 )
|
||||||
|
speed = 10;
|
||||||
|
if ( speed < 0 )
|
||||||
|
speed = 0;
|
||||||
|
|
||||||
step = 40. * (11 - options_dot_ResizeAnimation);
|
step = 40. * (11 - speed );
|
||||||
|
|
||||||
NETRect r = info->iconGeometry();
|
NETRect r = info->iconGeometry();
|
||||||
QRect icongeom( r.pos.x, r.pos.y, r.size.width, r.size.height );
|
QRect icongeom( r.pos.x, r.pos.y, r.size.width, r.size.height );
|
||||||
|
|
12
client.h
12
client.h
|
@ -117,6 +117,7 @@ public:
|
||||||
bool isMaximizable() const;
|
bool isMaximizable() const;
|
||||||
QRect geometryRestore() const;
|
QRect geometryRestore() const;
|
||||||
MaximizeMode maximizeMode() const;
|
MaximizeMode maximizeMode() const;
|
||||||
|
bool isMinimizable() const;
|
||||||
|
|
||||||
bool isSticky() const;
|
bool isSticky() const;
|
||||||
void setSticky( bool );
|
void setSticky( bool );
|
||||||
|
@ -126,9 +127,11 @@ public:
|
||||||
|
|
||||||
// auxiliary functions, depend on the windowType
|
// auxiliary functions, depend on the windowType
|
||||||
bool wantsTabFocus() const;
|
bool wantsTabFocus() const;
|
||||||
|
bool wantsInput() const;
|
||||||
bool isMovable() const;
|
bool isMovable() const;
|
||||||
bool isDesktop() const;
|
bool isDesktop() const;
|
||||||
bool isDock() const;
|
bool isDock() const;
|
||||||
|
bool isTool() const;
|
||||||
bool isMenu() const;
|
bool isMenu() const;
|
||||||
|
|
||||||
bool isResizable() const;
|
bool isResizable() const;
|
||||||
|
@ -142,6 +145,8 @@ public:
|
||||||
virtual void drawbound( const QRect& geom );
|
virtual void drawbound( const QRect& geom );
|
||||||
virtual void clearbound();
|
virtual void clearbound();
|
||||||
|
|
||||||
|
// fullscreen hint, for stacking
|
||||||
|
bool isFullScreen() const;
|
||||||
|
|
||||||
// shape extensions
|
// shape extensions
|
||||||
bool shape() const;
|
bool shape() const;
|
||||||
|
@ -264,6 +269,7 @@ private:
|
||||||
uint stays_on_top : 1;
|
uint stays_on_top : 1;
|
||||||
uint is_shape :1;
|
uint is_shape :1;
|
||||||
uint may_move :1;
|
uint may_move :1;
|
||||||
|
uint is_fullscreen :1;
|
||||||
uint skip_taskbar :1;
|
uint skip_taskbar :1;
|
||||||
uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol?
|
uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol?
|
||||||
uint Ptakefocus :1;// does the window understand the TakeFocus protocol?
|
uint Ptakefocus :1;// does the window understand the TakeFocus protocol?
|
||||||
|
@ -386,6 +392,12 @@ inline bool Client::shape() const
|
||||||
return is_shape;
|
return is_shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool Client::isFullScreen() const
|
||||||
|
{
|
||||||
|
return is_fullscreen;
|
||||||
|
}
|
||||||
|
|
||||||
inline const QRegion& Client::getMask() const
|
inline const QRegion& Client::getMask() const
|
||||||
{
|
{
|
||||||
return mask;
|
return mask;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
Client *allocate(Workspace *ws, WId w)
|
Client *allocate(Workspace *ws, WId w, int)
|
||||||
{
|
{
|
||||||
return(new B2Client(ws, w));
|
return(new B2Client(ws, w));
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,10 @@ Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
Client * allocate(Workspace * workSpace, WId winId)
|
Client * allocate(Workspace * workSpace, WId winId, int tool )
|
||||||
{
|
{
|
||||||
|
if ( tool )
|
||||||
|
return new StdToolClient( workSpace, winId );
|
||||||
return new StdClient(workSpace, winId);
|
return new StdClient(workSpace, winId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
Client *allocate(Workspace *ws, WId w)
|
Client *allocate(Workspace *ws, WId w, int )
|
||||||
{
|
{
|
||||||
return(new NextClient(ws, w));
|
return(new NextClient(ws, w));
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
Client *allocate(Workspace *ws, WId w)
|
Client *allocate(Workspace *ws, WId w, int)
|
||||||
{
|
{
|
||||||
return(new LaptopClient(ws, w));
|
return(new LaptopClient(ws, w));
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
Client *allocate(Workspace *ws, WId w)
|
Client *allocate(Workspace *ws, WId w, int)
|
||||||
{
|
{
|
||||||
return(new ModernSys(ws, w));
|
return(new ModernSys(ws, w));
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
Client * allocate(Workspace * workSpace, WId winId)
|
Client * allocate(Workspace * workSpace, WId winId, int)
|
||||||
{
|
{
|
||||||
return new RiscOS::Manager(workSpace, winId);
|
return new RiscOS::Manager(workSpace, winId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
Client *allocate(Workspace *ws, WId w)
|
Client *allocate(Workspace *ws, WId w, int)
|
||||||
{
|
{
|
||||||
return(new SystemClient(ws, w));
|
return(new SystemClient(ws, w));
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
Client *allocate(Workspace *ws, WId w)
|
Client *allocate(Workspace *ws, WId w, int)
|
||||||
{
|
{
|
||||||
return(new KDEClient(ws, w));
|
return(new KDEClient(ws, w));
|
||||||
}
|
}
|
||||||
|
@ -323,18 +323,22 @@ KDEClient::KDEClient( Workspace *ws, WId w, QWidget *parent,
|
||||||
g->addColSpacing(0, 4);
|
g->addColSpacing(0, 4);
|
||||||
g->addColSpacing(2, 4);
|
g->addColSpacing(2, 4);
|
||||||
|
|
||||||
button[BtnClose] = new KDEDefaultClientButton(27, titleHeight, this, "close", close_bits);
|
int th = titleHeight;
|
||||||
button[BtnSticky] = new KDEDefaultClientButton(17, titleHeight, this, "sticky");
|
if ( isTool() )
|
||||||
|
th -= 2;
|
||||||
|
|
||||||
|
button[BtnClose] = new KDEDefaultClientButton(27, th, this, "close", close_bits);
|
||||||
|
button[BtnSticky] = new KDEDefaultClientButton(17, th, this, "sticky");
|
||||||
if(isSticky())
|
if(isSticky())
|
||||||
button[BtnSticky]->setBitmap(unsticky_bits);
|
button[BtnSticky]->setBitmap(unsticky_bits);
|
||||||
else
|
else
|
||||||
button[BtnSticky]->setBitmap(sticky_bits);
|
button[BtnSticky]->setBitmap(sticky_bits);
|
||||||
button[BtnIconify] = new KDEDefaultClientButton(27, titleHeight, this, "iconify",
|
button[BtnIconify] = new KDEDefaultClientButton(27, th, this, "iconify",
|
||||||
iconify_bits);
|
iconify_bits);
|
||||||
button[BtnMax] = new KDEDefaultClientButton(27, titleHeight, this, "maximize",
|
button[BtnMax] = new KDEDefaultClientButton(27, th, this, "maximize",
|
||||||
maximize_bits);
|
maximize_bits);
|
||||||
if(help){
|
if(help){
|
||||||
button[BtnHelp] = new KDEDefaultClientButton(17, titleHeight, this, "help",
|
button[BtnHelp] = new KDEDefaultClientButton(17, th, this, "help",
|
||||||
question_bits);
|
question_bits);
|
||||||
connect(button[BtnHelp], SIGNAL( clicked() ), this, ( SLOT( contextHelp() ) ) );
|
connect(button[BtnHelp], SIGNAL( clicked() ), this, ( SLOT( contextHelp() ) ) );
|
||||||
}
|
}
|
||||||
|
@ -351,7 +355,7 @@ KDEClient::KDEClient( Workspace *ws, WId w, QWidget *parent,
|
||||||
g->addLayout( hb, 1, 1 );
|
g->addLayout( hb, 1, 1 );
|
||||||
hb->addWidget( button[BtnClose]);
|
hb->addWidget( button[BtnClose]);
|
||||||
hb->addSpacing(1);
|
hb->addSpacing(1);
|
||||||
titlebar = new QSpacerItem(10, titleHeight, QSizePolicy::Expanding,
|
titlebar = new QSpacerItem(10, th, QSizePolicy::Expanding,
|
||||||
QSizePolicy::Minimum);
|
QSizePolicy::Minimum);
|
||||||
hb->addItem(titlebar);
|
hb->addItem(titlebar);
|
||||||
hb->addSpacing(1);
|
hb->addSpacing(1);
|
||||||
|
@ -362,11 +366,12 @@ KDEClient::KDEClient( Workspace *ws, WId w, QWidget *parent,
|
||||||
hb->addWidget( button[BtnIconify]);
|
hb->addWidget( button[BtnIconify]);
|
||||||
hb->addWidget( button[BtnMax]);
|
hb->addWidget( button[BtnMax]);
|
||||||
|
|
||||||
if ( isTransient() ) {
|
if ( isTransient() || isTool() )
|
||||||
button[BtnSticky]->hide();
|
button[BtnSticky]->hide();
|
||||||
|
if ( !isMinimizable() )
|
||||||
button[BtnIconify]->hide();
|
button[BtnIconify]->hide();
|
||||||
|
if ( !isMaximizable() )
|
||||||
button[BtnMax]->hide();
|
button[BtnMax]->hide();
|
||||||
}
|
|
||||||
|
|
||||||
hiddenItems = false;
|
hiddenItems = false;
|
||||||
bufferDirty = true;
|
bufferDirty = true;
|
||||||
|
@ -429,9 +434,13 @@ void KDEClient::paintEvent( QPaintEvent* )
|
||||||
p.drawLine(r.right()-1, r.y()+1, r.right()-1, r.bottom()-1);
|
p.drawLine(r.right()-1, r.y()+1, r.right()-1, r.bottom()-1);
|
||||||
p.drawLine(r.x()+1, r.bottom()-1, r.right()-1, r.bottom()-1);
|
p.drawLine(r.x()+1, r.bottom()-1, r.right()-1, r.bottom()-1);
|
||||||
|
|
||||||
|
int th = titleHeight;
|
||||||
|
if ( isTool() )
|
||||||
|
th -= 2;
|
||||||
|
|
||||||
// inner rect
|
// inner rect
|
||||||
p.drawRect(r.x()+3, r.y()+titleHeight+3, r.width()-6,
|
p.drawRect(r.x()+3, r.y()+th+3, r.width()-6,
|
||||||
r.height()-titleHeight-10);
|
r.height()-th-10);
|
||||||
// handles
|
// handles
|
||||||
if(r.width() > 44){
|
if(r.width() > 44){
|
||||||
qDrawShadePanel(&p, r.x()+1, r.bottom()-6, 20,
|
qDrawShadePanel(&p, r.x()+1, r.bottom()-6, 20,
|
||||||
|
@ -464,7 +473,7 @@ void KDEClient::paintEvent( QPaintEvent* )
|
||||||
p.fillRect(r.x(), r.y(), r.width(), r.height()-1,
|
p.fillRect(r.x(), r.y(), r.width(), r.height()-1,
|
||||||
options->color(Options::TitleBar, false));
|
options->color(Options::TitleBar, false));
|
||||||
|
|
||||||
p.setFont(options->font(false));
|
p.setFont(options->font(false, isTool() ));
|
||||||
QFontMetrics fm(options->font(false));
|
QFontMetrics fm(options->font(false));
|
||||||
g = options->colorGroup(Options::TitleBar, false);
|
g = options->colorGroup(Options::TitleBar, false);
|
||||||
if(iUpperGradient)
|
if(iUpperGradient)
|
||||||
|
@ -582,7 +591,12 @@ void KDEClient::calcHiddenButtons()
|
||||||
if(button[i]){
|
if(button[i]){
|
||||||
if(button[i]->sizeHint().width() + totalSize <= width()){
|
if(button[i]->sizeHint().width() + totalSize <= width()){
|
||||||
totalSize+=button[i]->sizeHint().width();
|
totalSize+=button[i]->sizeHint().width();
|
||||||
if(button[i]->isHidden() && ( !isTransient() || ( i != BtnIconify && i != BtnSticky && i != BtnMax ) ) ){
|
if(button[i]->isHidden() &&
|
||||||
|
( !isTransient() || !isTransient() || i != BtnSticky ) &&
|
||||||
|
( isMinimizable() || i != BtnIconify ) &&
|
||||||
|
( isMaximizable() || ( i != BtnIconify && i != BtnSticky && i != BtnMax ) )
|
||||||
|
|
||||||
|
) {
|
||||||
button[i]->resize(button[i]->sizeHint());
|
button[i]->resize(button[i]->sizeHint());
|
||||||
button[i]->show();
|
button[i]->show();
|
||||||
}
|
}
|
||||||
|
@ -621,7 +635,7 @@ void KDEClient::updateActiveBuffer( )
|
||||||
if(titlePix)
|
if(titlePix)
|
||||||
p.drawTiledPixmap(r, *titlePix);
|
p.drawTiledPixmap(r, *titlePix);
|
||||||
|
|
||||||
p.setFont(options->font(true));
|
p.setFont(options->font(true, isTool() ));
|
||||||
QFontMetrics fm(options->font(true));
|
QFontMetrics fm(options->font(true));
|
||||||
QColorGroup g = options->colorGroup(Options::TitleBar, true);
|
QColorGroup g = options->colorGroup(Options::TitleBar, true);
|
||||||
if(aUpperGradient)
|
if(aUpperGradient)
|
||||||
|
|
|
@ -169,8 +169,8 @@ void Options::reload()
|
||||||
|
|
||||||
animateShade = config->readBoolEntry("AnimateShade", TRUE );
|
animateShade = config->readBoolEntry("AnimateShade", TRUE );
|
||||||
|
|
||||||
animSteps = config->readNumEntry("AnimSteps", 10);
|
animateMinimize = config->readBoolEntry("AnimateMinimize", TRUE );
|
||||||
|
animateMinimizeSpeed = config->readNumEntry("AnimateMinimizeSpeed", 1 );
|
||||||
|
|
||||||
autoRaise = config->readBoolEntry("AutoRaise", FALSE );
|
autoRaise = config->readBoolEntry("AutoRaise", FALSE );
|
||||||
autoRaiseInterval = config->readNumEntry("AutoRaiseInterval", 0 );
|
autoRaiseInterval = config->readNumEntry("AutoRaiseInterval", 0 );
|
||||||
|
|
15
options.h
15
options.h
|
@ -145,11 +145,6 @@ public:
|
||||||
*/
|
*/
|
||||||
bool animateShade;
|
bool animateShade;
|
||||||
|
|
||||||
/**
|
|
||||||
* the number of animation steps (would this be general?)
|
|
||||||
*/
|
|
||||||
int animSteps;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the size of the zone that triggers snapping on desktop borders
|
* the size of the zone that triggers snapping on desktop borders
|
||||||
*/
|
*/
|
||||||
|
@ -161,6 +156,16 @@ public:
|
||||||
int windowSnapZone;
|
int windowSnapZone;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether we animate the minimization of windows or not
|
||||||
|
*/
|
||||||
|
bool animateMinimize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Animation speed (0 .. 10 )
|
||||||
|
*/
|
||||||
|
int animateMinimizeSpeed;
|
||||||
|
|
||||||
|
|
||||||
// mouse bindings
|
// mouse bindings
|
||||||
|
|
||||||
|
|
|
@ -120,10 +120,10 @@ PluginMgr::~PluginMgr()
|
||||||
lt_dlclose(handle);
|
lt_dlclose(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
Client* PluginMgr::allocateClient(Workspace *ws, WId w)
|
Client* PluginMgr::allocateClient(Workspace *ws, WId w, bool tool)
|
||||||
{
|
{
|
||||||
if(alloc_ptr)
|
if(alloc_ptr)
|
||||||
return(alloc_ptr(ws, w));
|
return(alloc_ptr(ws, w, tool));
|
||||||
else
|
else
|
||||||
return(new KDEClient(ws, w));
|
return(new KDEClient(ws, w));
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ void PluginMgr::loadPlugin(QString nameStr)
|
||||||
else{
|
else{
|
||||||
lt_ptr_t alloc_func = lt_dlsym(handle, "allocate");
|
lt_ptr_t alloc_func = lt_dlsym(handle, "allocate");
|
||||||
if(alloc_func)
|
if(alloc_func)
|
||||||
alloc_ptr = (Client* (*)(Workspace *ws, WId w))alloc_func;
|
alloc_ptr = (Client* (*)(Workspace *ws, WId w, int tool))alloc_func;
|
||||||
else{
|
else{
|
||||||
qWarning("KWin: %s is not a KWin plugin.", nameStr.latin1());
|
qWarning("KWin: %s is not a KWin plugin.", nameStr.latin1());
|
||||||
lt_dlclose(handle);
|
lt_dlclose(handle);
|
||||||
|
|
|
@ -22,13 +22,13 @@ class PluginMgr : public QObject
|
||||||
public:
|
public:
|
||||||
PluginMgr();
|
PluginMgr();
|
||||||
~PluginMgr();
|
~PluginMgr();
|
||||||
Client *allocateClient(Workspace *ws, WId w);
|
Client *allocateClient(Workspace *ws, WId w, bool tool);
|
||||||
void loadPlugin(QString name);
|
void loadPlugin(QString name);
|
||||||
QString currentPlugin() { return pluginStr; }
|
QString currentPlugin() { return pluginStr; }
|
||||||
signals:
|
signals:
|
||||||
void resetAllClients();
|
void resetAllClients();
|
||||||
protected:
|
protected:
|
||||||
Client* (*alloc_ptr)(Workspace *ws, WId w);
|
Client* (*alloc_ptr)(Workspace *ws, WId w, int tool);
|
||||||
lt_dlhandle handle;
|
lt_dlhandle handle;
|
||||||
QString pluginStr;
|
QString pluginStr;
|
||||||
};
|
};
|
||||||
|
|
|
@ -162,13 +162,13 @@ Client* Workspace::clientFactory( WId w )
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
case NET::Toolbar:
|
case NET::Tool:
|
||||||
return (mgr.allocateClient(this,w) ); // TODO use mgr.allocateClient in toolbar mode
|
return ( mgr.allocateClient( this, w, true ) );
|
||||||
|
|
||||||
case NET::Menu:
|
case NET::Menu:
|
||||||
case NET::Dock:
|
case NET::Dock:
|
||||||
{
|
{
|
||||||
Client * c = new NoBorderClient( this, w);
|
Client * c = new NoBorderClient( this, w );
|
||||||
c->setSticky( TRUE );
|
c->setSticky( TRUE );
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ Client* Workspace::clientFactory( WId w )
|
||||||
if ( Shape::hasShape( w ) ){
|
if ( Shape::hasShape( w ) ){
|
||||||
return new NoBorderClient( this, w );
|
return new NoBorderClient( this, w );
|
||||||
}
|
}
|
||||||
return(mgr.allocateClient(this, w));
|
return ( mgr.allocateClient( this, w, false ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rikkus: This class is too complex. It needs splitting further.
|
// Rikkus: This class is too complex. It needs splitting further.
|
||||||
|
@ -703,6 +703,7 @@ bool Workspace::keyPress(XKeyEvent key)
|
||||||
tab_box->reset();
|
tab_box->reset();
|
||||||
}
|
}
|
||||||
tab_box->nextPrev( (km & ShiftMask) == 0 );
|
tab_box->nextPrev( (km & ShiftMask) == 0 );
|
||||||
|
keys->setEnabled( FALSE );
|
||||||
tab_box->delayedShow();
|
tab_box->delayedShow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -730,6 +731,7 @@ bool Workspace::keyPress(XKeyEvent key)
|
||||||
tab_box->reset();
|
tab_box->reset();
|
||||||
}
|
}
|
||||||
tab_box->nextPrev( (km & ShiftMask) == 0 );
|
tab_box->nextPrev( (km & ShiftMask) == 0 );
|
||||||
|
keys->setEnabled( FALSE );
|
||||||
tab_box->delayedShow();
|
tab_box->delayedShow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -739,6 +741,7 @@ bool Workspace::keyPress(XKeyEvent key)
|
||||||
XUngrabKeyboard(qt_xdisplay(), kwin_time);
|
XUngrabKeyboard(qt_xdisplay(), kwin_time);
|
||||||
XUngrabPointer( qt_xdisplay(), kwin_time);
|
XUngrabPointer( qt_xdisplay(), kwin_time);
|
||||||
tab_box->hide();
|
tab_box->hide();
|
||||||
|
keys->setEnabled( TRUE );
|
||||||
tab_grab = FALSE;
|
tab_grab = FALSE;
|
||||||
control_grab = FALSE;
|
control_grab = FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -766,6 +769,7 @@ bool Workspace::keyRelease(XKeyEvent key)
|
||||||
XUngrabKeyboard(qt_xdisplay(), kwin_time);
|
XUngrabKeyboard(qt_xdisplay(), kwin_time);
|
||||||
XUngrabPointer( qt_xdisplay(), kwin_time);
|
XUngrabPointer( qt_xdisplay(), kwin_time);
|
||||||
tab_box->hide();
|
tab_box->hide();
|
||||||
|
keys->setEnabled( TRUE );
|
||||||
tab_grab = false;
|
tab_grab = false;
|
||||||
if ( tab_box->currentClient() ){
|
if ( tab_box->currentClient() ){
|
||||||
|
|
||||||
|
@ -782,6 +786,7 @@ bool Workspace::keyRelease(XKeyEvent key)
|
||||||
XUngrabPointer( qt_xdisplay(), kwin_time);
|
XUngrabPointer( qt_xdisplay(), kwin_time);
|
||||||
XUngrabKeyboard(qt_xdisplay(), kwin_time);
|
XUngrabKeyboard(qt_xdisplay(), kwin_time);
|
||||||
tab_box->hide();
|
tab_box->hide();
|
||||||
|
keys->setEnabled( TRUE );
|
||||||
control_grab = False;
|
control_grab = False;
|
||||||
if ( tab_box->currentDesktop() != -1 )
|
if ( tab_box->currentDesktop() != -1 )
|
||||||
setCurrentDesktop( tab_box->currentDesktop() );
|
setCurrentDesktop( tab_box->currentDesktop() );
|
||||||
|
@ -1071,6 +1076,7 @@ void Workspace::requestFocus( Client* c, bool force )
|
||||||
} else if ( c->isShade() ) {
|
} else if ( c->isShade() ) {
|
||||||
// client cannot accept focus, but at least the window should be active (window menu, et. al. )
|
// client cannot accept focus, but at least the window should be active (window menu, et. al. )
|
||||||
focusToNull();
|
focusToNull();
|
||||||
|
if ( c->wantsInput() )
|
||||||
c->setActive( TRUE );
|
c->setActive( TRUE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1653,6 +1659,26 @@ void Workspace::raiseClient( Client* c )
|
||||||
raiseTransientsOf(saveset, c );
|
raiseTransientsOf(saveset, c );
|
||||||
|
|
||||||
ClientList list = constrainedStackingOrder( stacking_order );
|
ClientList list = constrainedStackingOrder( stacking_order );
|
||||||
|
|
||||||
|
/* workaround to help broken full-screen applications to keep (modal) dialogs visible
|
||||||
|
*/
|
||||||
|
if ( c->isTransient() && c->mainClient() == c ) {
|
||||||
|
bool has_full_screen = false;
|
||||||
|
for ( ClientList::ConstIterator it = list.fromLast(); it != list.end(); --it) {
|
||||||
|
if ( (*it) == c )
|
||||||
|
break;
|
||||||
|
if ( (*it)->isVisible() && (*it)->isFullScreen() ) {
|
||||||
|
has_full_screen = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( has_full_screen ) {
|
||||||
|
list.remove( c );
|
||||||
|
list.append( c );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* end workaround */
|
||||||
|
|
||||||
Window* new_stack = new Window[ list.count() + 1 ];
|
Window* new_stack = new Window[ list.count() + 1 ];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for ( ClientList::ConstIterator it = list.fromLast(); it != list.end(); --it) {
|
for ( ClientList::ConstIterator it = list.fromLast(); it != list.end(); --it) {
|
||||||
|
@ -2309,6 +2335,10 @@ void Workspace::slotWindowOperations()
|
||||||
*/
|
*/
|
||||||
void Workspace::slotWindowClose()
|
void Workspace::slotWindowClose()
|
||||||
{
|
{
|
||||||
|
if ( tab_box->isVisible() ) {
|
||||||
|
qDebug("ARGGGLLLLLLLLL");
|
||||||
|
return;
|
||||||
|
}
|
||||||
performWindowOperation( popup_client, Options::CloseOp );
|
performWindowOperation( popup_client, Options::CloseOp );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue