Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 206372 Details for
Bug 288125
app-misc/workrave timer stop working after upgrade to xorg-server-1.6
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch from upstream
workrave-1.9.0-xorg-server-1.6.patch (text/plain), 6.61 KB, created by
Jules Gagnon
on 2009-10-07 21:36:32 UTC
(
hide
)
Description:
patch from upstream
Filename:
MIME Type:
Creator:
Jules Gagnon
Created:
2009-10-07 21:36:32 UTC
Size:
6.61 KB
patch
obsolete
>From 33f01a179da87e27dca3d57662872ef7077efb22 Mon Sep 17 00:00:00 2001 >From: Rob Caelers <robc@krandor.org> >Date: Sat, 24 Jan 2009 12:19:25 +0000 >Subject: initial fix for bug #804 > >--- >diff --git a/backend/src/unix/X11InputMonitor.cc b/backend/src/unix/X11InputMonitor.cc >index 977f033..b0ac48e 100644 >--- a/backend/src/unix/X11InputMonitor.cc >+++ b/backend/src/unix/X11InputMonitor.cc >@@ -1,6 +1,6 @@ > // X11InputMonitor.cc --- ActivityMonitor for X11 > // >-// Copyright (C) 2001-2007 Rob Caelers <robc@krandor.nl> >+// Copyright (C) 2001-2007, 2009 Rob Caelers <robc@krandor.nl> > // All rights reserved. > // > // This program is free software: you can redistribute it and/or modify >@@ -63,6 +63,7 @@ static const char rcsid[] = "$Id$"; > #include <X11/Xproto.h> > #include <X11/Xlib.h> > #include <X11/extensions/XInput.h> >+#include <X11/extensions/XIproto.h> > #include <X11/Intrinsic.h> > #include <X11/Xos.h> > #include <X11/Xmu/Error.h> >@@ -80,6 +81,8 @@ static const char rcsid[] = "$Id$"; > > using namespace std; > >+int X11InputMonitor::xi_event_base = 0; >+ > #ifndef HAVE_APP_GTK > //! Intercepts X11 protocol errors. > static int >@@ -438,7 +441,6 @@ X11InputMonitor::handle_xrecord_handle_motion_event(XRecordInterceptData *data) > } > } > >- > void > X11InputMonitor::handle_xrecord_handle_button_event(XRecordInterceptData *data) > { >@@ -456,6 +458,48 @@ X11InputMonitor::handle_xrecord_handle_button_event(XRecordInterceptData *data) > } > } > >+void >+X11InputMonitor::handle_xrecord_handle_device_key_event(XRecordInterceptData *data) >+{ >+ (void) data; >+ fire_keyboard(0, 0); >+} >+ >+void >+X11InputMonitor::handle_xrecord_handle_device_motion_event(XRecordInterceptData *data) >+{ >+ deviceKeyButtonPointer *event = (deviceKeyButtonPointer *)data->data; >+ >+ if (event != NULL) >+ { >+ int x = event->root_x; >+ int y = event->root_y; >+ >+ fire_mouse(x, y, 0); >+ } >+ else >+ { >+ fire_action(); >+ } >+} >+ >+void >+X11InputMonitor::handle_xrecord_handle_device_button_event(XRecordInterceptData *data) >+{ >+ deviceKeyButtonPointer *event = (deviceKeyButtonPointer *)data->data; >+ >+ if (event != NULL) >+ { >+ // FIXME: check if this is correct >+ int b = event->state; >+ >+ fire_button(b, event->type == xi_event_base + XI_DeviceButtonPress); >+ } >+ else >+ { >+ fire_action(); >+ } >+} > > void > X11InputMonitor::handle_xrecord_callback(XPointer closure, XRecordInterceptData * data) >@@ -481,6 +525,23 @@ X11InputMonitor::handle_xrecord_callback(XPointer closure, XRecordInterceptData > monitor->handle_xrecord_handle_button_event(data); > else if (event->u.u.type == MotionNotify) > monitor->handle_xrecord_handle_motion_event(data); >+ else if (xi_event_base != 0) >+ { >+ if (event->u.u.type == xi_event_base + XI_DeviceMotionNotify) >+ { >+ monitor->handle_xrecord_handle_device_motion_event(data); >+ } >+ else if (event->u.u.type == xi_event_base + XI_DeviceKeyPress || >+ event->u.u.type == xi_event_base + XI_DeviceKeyRelease) >+ { >+ monitor->handle_xrecord_handle_device_key_event(data); >+ } >+ else if (event->u.u.type == xi_event_base + XI_DeviceButtonPress || >+ event->u.u.type == xi_event_base + XI_DeviceButtonRelease) >+ { >+ monitor->handle_xrecord_handle_device_button_event(data); >+ } >+ } > break; > } > >@@ -518,7 +579,7 @@ bool > X11InputMonitor::init_xrecord() > { > TRACE_ENTER("X11InputMonitor::init_xrecord") >- use_xrecord = false; >+ use_xrecord = false; > > int major, minor; > >@@ -533,18 +594,40 @@ X11InputMonitor::init_xrecord() > > // Receive KeyPress, KeyRelease, ButtonPress, ButtonRelease and > // MotionNotify events. >- XRecordRange *recordRange = XRecordAllocRange(); >- if (recordRange != NULL) >- { >- memset(recordRange, 0, sizeof(XRecordRange)); >- recordRange->device_events.first = KeyPress; >- recordRange->device_events.last = MotionNotify; >+ XRecordRange *recordRanges[2]; >+ int recordRangesLen = 1; >+ recordRanges[0] = XRecordAllocRange(); >+ memset(recordRanges[0], 0, sizeof(XRecordRange)); >+ recordRanges[0]->device_events.first = KeyPress; >+ recordRanges[0]->device_events.last = MotionNotify; >+ >+#ifdef XI_DeviceMotionNotify >+ TRACE_MSG("Trying XI"); >+ >+ int dummy = 0; >+ Bool ok = XQueryExtension(x11_display, "XInputExtension", >+ &dummy, &xi_event_base, &dummy); > >- // And create the XRECORD context. >- xrecord_context = XRecordCreateContext(x11_display, 0, &client, 1, &recordRange, 1); >+ if (ok) >+ { >+ TRACE_MSG("XI Ok " << xi_event_base); > >- XFree(recordRange); >+ recordRanges[1] = XRecordAllocRange(); >+ memset(recordRanges[1], 0, sizeof(XRecordRange)); >+ recordRanges[1]->device_events.first = xi_event_base + XI_DeviceKeyPress; >+ recordRanges[1]->device_events.last = xi_event_base + XI_DeviceMotionNotify; >+ recordRangesLen = 2; > } >+#endif >+ // And create the XRECORD context. >+ xrecord_context = XRecordCreateContext(x11_display, 0, &client, 1, recordRanges, recordRangesLen); >+ >+ XFree(recordRanges[0]); >+ >+#ifdef DeviceMotionNotify >+ XFree(recordRanges[1]); >+#endif >+ > > if (xrecord_context != 0) > { >diff --git a/backend/src/unix/X11InputMonitor.hh b/backend/src/unix/X11InputMonitor.hh >index 7f118e4..ccfcbc3 100644 >--- a/backend/src/unix/X11InputMonitor.hh >+++ b/backend/src/unix/X11InputMonitor.hh >@@ -1,6 +1,6 @@ > // X11InputMonitor.hh --- ActivityMonitor for X11 > // >-// Copyright (C) 2001, 2002, 2003, 2006, 2007, 2008 Rob Caelers <robc@krandor.nl> >+// Copyright (C) 2001, 2002, 2003, 2006, 2007, 2008, 2009 Rob Caelers <robc@krandor.nl> > // All rights reserved. > // > // This program is free software: you can redistribute it and/or modify >@@ -77,6 +77,9 @@ private: > void handle_xrecord_handle_key_event(XRecordInterceptData *data); > void handle_xrecord_handle_motion_event(XRecordInterceptData *data); > void handle_xrecord_handle_button_event(XRecordInterceptData *data); >+ void handle_xrecord_handle_device_key_event(XRecordInterceptData *data); >+ void handle_xrecord_handle_device_motion_event(XRecordInterceptData *data); >+ void handle_xrecord_handle_device_button_event(XRecordInterceptData *data); > > static void handle_xrecord_callback(XPointer closure, XRecordInterceptData * data); > #endif >@@ -122,6 +125,8 @@ private: > > //! X Connection for event capturing. > Display *xrecord_datalink; >+ >+ static int xi_event_base; > #endif > }; > >-- >cgit v0.8.2.1-33-ge0dc
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 288125
: 206372 |
206373