deal with client events in the same way now

This commit is contained in:
Dana Jansens 2002-11-04 09:33:23 +00:00
parent 45c2589ef6
commit 2f905c7ed8
3 changed files with 281 additions and 273 deletions

View file

@ -116,9 +116,6 @@ public:
*/
void eventLoop();
// XXX: TEMPORARY!#!@%*!^#*!#!#!
virtual void process_event(XEvent *) = 0;
//! Requests that the window manager exit
/*!
Causes the Openbox::eventLoop function to stop looping, so that the window

View file

@ -384,95 +384,11 @@ void OBXEventHandler::shapeEvent(const XShapeEvent &e)
#endif // SHAPE
void OBXEventHandler::handle(const XEvent &e)
void OBXEventHandler::clientMessage(const XClientMessageEvent &e)
{
/* mouse button events can get translated into:
press - button was pressed down
release - buttons was released
click - button was pressed and released on the same window
double click - clicked twice on the same widget in a given time and area
key events are only bindable to presses. key releases are ignored.
mouse enter/leave can be bound to for the entire window
*/
switch (e.type) {
// These types of XEvent's can be bound to actions by the user, and so end
// up getting passed off to the OBBindingMapper class at some point
case ButtonPress:
buttonPress(e.xbutton);
break;
case ButtonRelease:
buttonRelease(e.xbutton);
break;
case KeyPress:
keyPress(e.xkey);
break;
case MotionNotify:
motion(e.xmotion);
break;
case EnterNotify:
enterNotify(e.xcrossing);
break;
case LeaveNotify:
leaveNotify(e.xcrossing);
break;
// These types of XEvent's can not be bound to actions by the user and so
// will simply be handled in this class
case ConfigureRequest:
configureRequest(e.xconfigurerequest);
break;
case MapRequest:
mapRequest(e.xmaprequest);
break;
case UnmapNotify:
unmapNotify(e.xunmap);
break;
case DestroyNotify:
destroyNotify(e.xdestroywindow);
break;
case ReparentNotify:
reparentNotify(e.xreparent);
break;
case PropertyNotify:
propertyNotify(e.xproperty);
break;
case Expose:
expose(e.xexpose);
break;
case ColormapNotify:
colormapNotify(e.xcolormap);
break;
case FocusIn:
focusIn(e.xfocus);
break;
case FocusOut:
focusOut(e.xfocus);
break;
default:
#ifdef SHAPE
if (e.type == otk::OBDisplay::shapeEventBase())
shapeEvent(e);
#endif // SHAPE
break;
if (e.format != 32)
return;
/*
case ClientMessage: {
if (e->xclient.format == 32) {
if (e->xclient.message_type == xatom->getAtom(XAtom::wm_change_state)) {
// WM_CHANGE_STATE message
BlackboxWindow *win = searchWindow(e->xclient.window);
@ -735,15 +651,104 @@ void OBXEventHandler::handle(const XEvent &e)
}
}
}
}
*/
}
void OBXEventHandler::handle(const XEvent &e)
{
/* mouse button events can get translated into:
press - button was pressed down
release - buttons was released
click - button was pressed and released on the same window
double click - clicked twice on the same widget in a given time and area
key events are only bindable to presses. key releases are ignored.
mouse enter/leave can be bound to for the entire window
*/
switch (e.type) {
// These types of XEvent's can be bound to actions by the user, and so end
// up getting passed off to the OBBindingMapper class at some point
case ButtonPress:
buttonPress(e.xbutton);
break;
case ButtonRelease:
buttonRelease(e.xbutton);
break;
case KeyPress:
keyPress(e.xkey);
break;
case MotionNotify:
motion(e.xmotion);
break;
case EnterNotify:
enterNotify(e.xcrossing);
break;
case LeaveNotify:
leaveNotify(e.xcrossing);
break;
// These types of XEvent's can not be bound to actions by the user and so
// will simply be handled in this class
case ConfigureRequest:
configureRequest(e.xconfigurerequest);
break;
case MapRequest:
mapRequest(e.xmaprequest);
break;
case UnmapNotify:
unmapNotify(e.xunmap);
break;
case DestroyNotify:
destroyNotify(e.xdestroywindow);
break;
case ReparentNotify:
reparentNotify(e.xreparent);
break;
case PropertyNotify:
propertyNotify(e.xproperty);
break;
case Expose:
expose(e.xexpose);
break;
case ColormapNotify:
colormapNotify(e.xcolormap);
break;
case FocusIn:
focusIn(e.xfocus);
break;
case FocusOut:
focusOut(e.xfocus);
break;
case ClientMessage:
clientMessage(e.xclient);
default:
#ifdef SHAPE
if (e.type == otk::OBDisplay::shapeEventBase())
shapeEvent(e);
#endif // SHAPE
break;
/*
case ClientMessage: {
break;
}
case NoExpose:
case ConfigureNotify:
case MapNotify:
break; // not handled, just ignore
*/
} // switch
}

View file

@ -121,6 +121,12 @@ private:
*/
void shapeEvent(const XShapeEvent &e);
#endif // SHAPE
//! Handles client message events
/*!
@param e The XEvent to handle
*/
void clientMessage(const XClientMessageEvent &e);
public:
//! Constructs an OBXEventHandler object