formatting cleanup for X11Application.m (no code changes)
(cherry picked from commit eb083d3f68f459d90417558da1ed00729b749950)
This commit is contained in:
parent
e9e2d88436
commit
15b0084f1a
|
@ -216,7 +216,6 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
|
||||||
|
|
||||||
if ([self isActive]) {
|
if ([self isActive]) {
|
||||||
[self deactivate];
|
[self deactivate];
|
||||||
|
|
||||||
if (!_x_active && quartzProcs->IsX11Window([e window],
|
if (!_x_active && quartzProcs->IsX11Window([e window],
|
||||||
[e windowNumber]))
|
[e windowNumber]))
|
||||||
[self activateX:YES];
|
[self activateX:YES];
|
||||||
|
@ -855,19 +854,13 @@ convert_flags (unsigned int nsflags) {
|
||||||
return xflags;
|
return xflags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// This code should probably be merged with that in XDarwin's XServer.m - BB
|
|
||||||
static void send_nsevent (NSEventType type, NSEvent *e) {
|
static void send_nsevent (NSEventType type, NSEvent *e) {
|
||||||
// static unsigned int button_state = 0;
|
|
||||||
NSRect screen;
|
NSRect screen;
|
||||||
NSPoint location;
|
NSPoint location;
|
||||||
NSWindow *window;
|
NSWindow *window;
|
||||||
int pointer_x, pointer_y, ev_button, ev_type;
|
int pointer_x, pointer_y, ev_button, ev_type;
|
||||||
float pressure, tilt_x, tilt_y;
|
float pressure, tilt_x, tilt_y;
|
||||||
|
|
||||||
// int num_events=0, i=0, state;
|
|
||||||
// xEvent xe;
|
|
||||||
|
|
||||||
/* convert location to global top-left coordinates */
|
/* convert location to global top-left coordinates */
|
||||||
location = [e locationInWindow];
|
location = [e locationInWindow];
|
||||||
window = [e window];
|
window = [e window];
|
||||||
|
@ -884,7 +877,6 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pointer_y -= aquaMenuBarHeight;
|
pointer_y -= aquaMenuBarHeight;
|
||||||
// state = convert_flags ([e modifierFlags]);
|
|
||||||
|
|
||||||
pressure = 0; // for tablets
|
pressure = 0; // for tablets
|
||||||
tilt_x = 0;
|
tilt_x = 0;
|
||||||
|
@ -907,28 +899,17 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
|
||||||
case NSMouseMoved: ev_button=0; ev_type=MotionNotify; goto handle_mouse;
|
case NSMouseMoved: ev_button=0; ev_type=MotionNotify; goto handle_mouse;
|
||||||
handle_mouse:
|
handle_mouse:
|
||||||
|
|
||||||
/* I'm not sure the below code is necessary or useful (-bb)
|
// if ([e subtype] == NSTabletPointEventSubtype) pressure = [e pressure];
|
||||||
if(ev_type==ButtonPress) {
|
|
||||||
if (!quartzProcs->IsX11Window([e window], [e windowNumber])) {
|
|
||||||
fprintf(stderr, "Dropping event because it's not a window\n");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
button_state |= (1 << ev_button);
|
|
||||||
DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y);
|
|
||||||
} else if (ev_type==ButtonRelease && (button_state & (1 << ev_button)) == 0) break;
|
|
||||||
*/
|
|
||||||
|
|
||||||
// if ([e subtype] == NSTabletPointEventSubtype) pressure = [e pressure];
|
|
||||||
DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y,
|
DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y,
|
||||||
pressure, tilt_x, tilt_y);
|
pressure, tilt_x, tilt_y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NSScrollWheel:
|
case NSScrollWheel:
|
||||||
DarwinSendScrollEvents([e deltaY], pointer_x, pointer_y,
|
DarwinSendScrollEvents([e deltaY], pointer_x, pointer_y,
|
||||||
pressure, tilt_x, tilt_y);
|
pressure, tilt_x, tilt_y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NSKeyDown: // do we need to translate these keyCodes?
|
case NSKeyDown: case NSKeyUp:
|
||||||
case NSKeyUp:
|
|
||||||
DarwinSendKeyboardEvents((type == NSKeyDown)?KeyPress:KeyRelease, [e keyCode]);
|
DarwinSendKeyboardEvents((type == NSKeyDown)?KeyPress:KeyRelease, [e keyCode]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue