CurrentTime must die
svn path=/trunk/kdebase/kwin/; revision=35369
This commit is contained in:
parent
b529c9226f
commit
b8a8bf9be2
3 changed files with 33 additions and 10 deletions
|
@ -17,6 +17,7 @@
|
|||
#include <X11/extensions/shape.h>
|
||||
|
||||
extern Atom qt_wm_state;
|
||||
extern Time kwin_time;
|
||||
|
||||
|
||||
static QRect* visible_bound = 0;
|
||||
|
@ -63,7 +64,7 @@ static void sendClientMessage(Window w, Atom a, long x){
|
|||
ev.xclient.message_type = a;
|
||||
ev.xclient.format = 32;
|
||||
ev.xclient.data.l[0] = x;
|
||||
ev.xclient.data.l[1] = CurrentTime;
|
||||
ev.xclient.data.l[1] = kwin_time;
|
||||
mask = 0L;
|
||||
if (w == qt_xrootwin())
|
||||
mask = SubstructureRedirectMask; /* magic! */
|
||||
|
@ -1540,7 +1541,7 @@ void Client::getWindowProtocols(){
|
|||
void Client::takeFocus()
|
||||
{
|
||||
if ( input )
|
||||
XSetInputFocus( qt_xdisplay(), win, RevertToPointerRoot, CurrentTime );
|
||||
XSetInputFocus( qt_xdisplay(), win, RevertToPointerRoot, kwin_time );
|
||||
if ( Ptakefocus )
|
||||
sendClientMessage(win, atoms->wm_protocols, atoms->wm_take_focus);
|
||||
}
|
||||
|
|
20
main.cpp
20
main.cpp
|
@ -20,6 +20,8 @@
|
|||
Options* options;
|
||||
Atoms* atoms;
|
||||
|
||||
Time kwin_time = CurrentTime;
|
||||
|
||||
static bool initting = FALSE;
|
||||
int x11ErrorHandler(Display *d, XErrorEvent *e){
|
||||
char msg[80], req[80], number[80];
|
||||
|
@ -85,6 +87,24 @@ Application::~Application()
|
|||
|
||||
bool Application::x11EventFilter( XEvent *e )
|
||||
{
|
||||
switch ( e->type ) {
|
||||
case ButtonPress:
|
||||
case ButtonRelease:
|
||||
case MotionNotify:
|
||||
kwin_time = (e->type == MotionNotify) ?
|
||||
e->xmotion.time : e->xbutton.time;
|
||||
break;
|
||||
case KeyPress:
|
||||
case KeyRelease:
|
||||
kwin_time = e->xkey.time;
|
||||
break;
|
||||
case PropertyNotify:
|
||||
kwin_time = e->xproperty.time;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
for ( WorkspaceList::Iterator it = workspaces.begin(); it != workspaces.end(); ++it) {
|
||||
if ( (*it)->workspaceEvent( e ) )
|
||||
return TRUE;
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include <X11/keysym.h>
|
||||
#include <X11/extensions/shape.h>
|
||||
|
||||
extern Time kwin_time;
|
||||
|
||||
// used to store the return values of
|
||||
// XShapeQueryExtension.
|
||||
// Necessary since shaped window are an extension to X
|
||||
|
@ -447,9 +449,9 @@ bool Workspace::destroyClient( Client* c)
|
|||
*/
|
||||
void Workspace::freeKeyboard(bool pass){
|
||||
if (!pass)
|
||||
XAllowEvents(qt_xdisplay(), AsyncKeyboard, CurrentTime);
|
||||
XAllowEvents(qt_xdisplay(), AsyncKeyboard, kwin_time);
|
||||
else
|
||||
XAllowEvents(qt_xdisplay(), ReplayKeyboard, CurrentTime);
|
||||
XAllowEvents(qt_xdisplay(), ReplayKeyboard, kwin_time);
|
||||
QApplication::syncX();
|
||||
}
|
||||
|
||||
|
@ -500,7 +502,7 @@ bool Workspace::keyPress(XKeyEvent key)
|
|||
XGrabKeyboard(qt_xdisplay(),
|
||||
root, FALSE,
|
||||
GrabModeAsync, GrabModeAsync,
|
||||
CurrentTime);
|
||||
kwin_time);
|
||||
tab_grab = TRUE;
|
||||
tab_box->setMode( TabBox::WindowsMode );
|
||||
tab_box->reset();
|
||||
|
@ -525,7 +527,7 @@ bool Workspace::keyPress(XKeyEvent key)
|
|||
XGrabKeyboard(qt_xdisplay(),
|
||||
root, FALSE,
|
||||
GrabModeAsync, GrabModeAsync,
|
||||
CurrentTime);
|
||||
kwin_time);
|
||||
control_grab = TRUE;
|
||||
tab_box->setMode( TabBox::DesktopMode );
|
||||
tab_box->reset();
|
||||
|
@ -537,7 +539,7 @@ bool Workspace::keyPress(XKeyEvent key)
|
|||
|
||||
if (control_grab || tab_grab){
|
||||
if (kc == XK_Escape){
|
||||
XUngrabKeyboard(qt_xdisplay(), CurrentTime);
|
||||
XUngrabKeyboard(qt_xdisplay(), kwin_time);
|
||||
tab_box->hide();
|
||||
tab_grab = FALSE;
|
||||
control_grab = FALSE;
|
||||
|
@ -563,7 +565,7 @@ bool Workspace::keyRelease(XKeyEvent key)
|
|||
for (i=0; i<xmk->max_keypermod; i++)
|
||||
if (xmk->modifiermap[xmk->max_keypermod * Mod1MapIndex + i]
|
||||
== key.keycode){
|
||||
XUngrabKeyboard(qt_xdisplay(), CurrentTime);
|
||||
XUngrabKeyboard(qt_xdisplay(), kwin_time);
|
||||
tab_box->hide();
|
||||
tab_grab = false;
|
||||
if ( tab_box->currentClient() ){
|
||||
|
@ -577,7 +579,7 @@ bool Workspace::keyRelease(XKeyEvent key)
|
|||
for (i=0; i<xmk->max_keypermod; i++)
|
||||
if (xmk->modifiermap[xmk->max_keypermod * ControlMapIndex + i]
|
||||
== key.keycode){
|
||||
XUngrabKeyboard(qt_xdisplay(), CurrentTime);
|
||||
XUngrabKeyboard(qt_xdisplay(), kwin_time);
|
||||
tab_box->hide();
|
||||
control_grab = False;
|
||||
if ( tab_box->currentDesktop() != -1 )
|
||||
|
@ -1244,7 +1246,7 @@ void Workspace::focusToNull(){
|
|||
InputOnly, CopyFromParent, mask, &attr);
|
||||
XMapWindow(qt_xdisplay(), w);
|
||||
}
|
||||
XSetInputFocus(qt_xdisplay(), w, RevertToPointerRoot, CurrentTime );
|
||||
XSetInputFocus(qt_xdisplay(), w, RevertToPointerRoot, kwin_time );
|
||||
//colormapFocus(0); TODO
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue