lather, rinse, repeat fred's fix: close on button release not press
svn path=/trunk/kdebase/kwin/; revision=237267
This commit is contained in:
parent
ffebd22c8a
commit
ddec9444f7
2 changed files with 18 additions and 7 deletions
|
@ -597,7 +597,8 @@ void KDEDefaultButton::mouseReleaseEvent( QMouseEvent* e )
|
|||
KDEDefaultClient::KDEDefaultClient( Workspace *ws, WId w, QWidget *parent,
|
||||
const char *name )
|
||||
: Client( ws, w, parent, name, WResizeNoErase | WStaticContents |
|
||||
WRepaintNoErase )
|
||||
WRepaintNoErase ),
|
||||
m_closing(false)
|
||||
{
|
||||
// No flicker thanks
|
||||
setBackgroundMode( QWidget::NoBackground );
|
||||
|
@ -665,6 +666,8 @@ void KDEDefaultClient::addClientButtons( const QString& s, bool isLeft )
|
|||
largeButtons, isLeft, false, NULL, i18n("Menu"));
|
||||
connect( button[BtnMenu], SIGNAL(pressed()),
|
||||
this, SLOT(menuButtonPressed()) );
|
||||
connect( button[BtnMenu], SIGNAL(released()),
|
||||
this, SLOT(menuButtonReleased()));
|
||||
hb->addWidget( button[BtnMenu] );
|
||||
}
|
||||
break;
|
||||
|
@ -1081,7 +1084,7 @@ void KDEDefaultClient::menuButtonPressed()
|
|||
|
||||
if (dbl)
|
||||
{
|
||||
closeWindow();
|
||||
m_closing = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1091,6 +1094,12 @@ void KDEDefaultClient::menuButtonPressed()
|
|||
button[BtnMenu]->setDown(false);
|
||||
}
|
||||
|
||||
void KDEDefaultClient::menuButtonReleased()
|
||||
{
|
||||
if (m_closing)
|
||||
closeWindow();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Extended KWin plugin interface
|
||||
|
|
|
@ -39,7 +39,7 @@ class KDEDefaultHandler: public QObject
|
|||
void readConfig();
|
||||
void createPixmaps();
|
||||
void freePixmaps();
|
||||
void drawButtonBackground(KPixmap *pix,
|
||||
void drawButtonBackground(KPixmap *pix,
|
||||
const QColorGroup &g, bool sunken);
|
||||
};
|
||||
|
||||
|
@ -47,11 +47,11 @@ class KDEDefaultHandler: public QObject
|
|||
class KDEDefaultButton : public KWinButton
|
||||
{
|
||||
public:
|
||||
KDEDefaultButton(Client *parent=0, const char *name=0,
|
||||
KDEDefaultButton(Client *parent=0, const char *name=0,
|
||||
bool largeButton=true, bool isLeftButton=true,
|
||||
bool isStickyButton=false, const unsigned char *bitmap=NULL,
|
||||
const QString& tip=NULL);
|
||||
~KDEDefaultButton();
|
||||
~KDEDefaultButton();
|
||||
|
||||
int last_button;
|
||||
void turnOn( bool isOn );
|
||||
|
@ -80,7 +80,7 @@ class KDEDefaultClient : public Client
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
KDEDefaultClient( Workspace *ws, WId w, QWidget *parent=0,
|
||||
KDEDefaultClient( Workspace *ws, WId w, QWidget *parent=0,
|
||||
const char *name=0 );
|
||||
~KDEDefaultClient() {;}
|
||||
|
||||
|
@ -99,13 +99,14 @@ class KDEDefaultClient : public Client
|
|||
protected slots:
|
||||
void slotMaximize();
|
||||
void menuButtonPressed();
|
||||
void menuButtonReleased();
|
||||
|
||||
private:
|
||||
void doShape();
|
||||
void calcHiddenButtons();
|
||||
void addClientButtons( const QString& s, bool isLeft=true );
|
||||
|
||||
enum Buttons{ BtnHelp=0, BtnMax, BtnIconify, BtnClose,
|
||||
enum Buttons{ BtnHelp=0, BtnMax, BtnIconify, BtnClose,
|
||||
BtnMenu, BtnSticky, BtnCount };
|
||||
KDEDefaultButton* button[ KDEDefaultClient::BtnCount ];
|
||||
int lastButtonWidth;
|
||||
|
@ -113,6 +114,7 @@ class KDEDefaultClient : public Client
|
|||
bool largeButtons;
|
||||
QBoxLayout* hb;
|
||||
QSpacerItem* titlebar;
|
||||
bool m_closing;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue