rpms/workrave/F-12 workrave-1.9.1-abort.patch, NONE, 1.1 workrave-1.9.1-compile.patch, NONE, 1.1
Tomáš Mráz
tmraz at fedoraproject.org
Fri May 14 09:57:17 UTC 2010
Author: tmraz
Update of /cvs/pkgs/rpms/workrave/F-12
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv8759
Added Files:
workrave-1.9.1-abort.patch workrave-1.9.1-compile.patch
Log Message:
* Mon Apr 26 2010 Tomas Mraz <tmraz at redhat.com> - 1.9.1-4
- better guard for BadWindow errors in input monitor (#566156)
workrave-1.9.1-abort.patch:
backend/src/unix/Makefile.in | 2 -
backend/src/unix/X11InputMonitor.cc | 67 +++++++++++++++++++++---------------
backend/src/unix/X11InputMonitor.hh | 5 ++
configure | 2 -
configure.ac | 2 -
5 files changed, 47 insertions(+), 31 deletions(-)
--- NEW FILE workrave-1.9.1-abort.patch ---
diff -up workrave-1.9.1/backend/src/unix/Makefile.in.abort workrave-1.9.1/backend/src/unix/Makefile.in
--- workrave-1.9.1/backend/src/unix/Makefile.in.abort 2009-10-25 12:14:58.000000000 +0100
+++ workrave-1.9.1/backend/src/unix/Makefile.in 2010-04-26 10:56:53.000000000 +0200
@@ -435,7 +435,7 @@ libworkrave_backend_unix_la_CXXFLAGS = \
-DWORKRAVE_PKGDATADIR="\"${pkgdatadir}\"" \
-D_XOPEN_SOURCE=600 \
@WR_COMMON_INCLUDES@ \
- @GLIB_CFLAGS@ @GCONF_CFLAGS@
+ @GLIB_CFLAGS@ @GCONF_CFLAGS@ @GTK_CFLAGS@
EXTRA_DIST = $(wildcard *.cc) $(wildcard *.rc)\
$(wildcard *.hh) $(wildcard *.h) $(wildcard *.icc)
diff -up workrave-1.9.1/backend/src/unix/X11InputMonitor.cc.abort workrave-1.9.1/backend/src/unix/X11InputMonitor.cc
--- workrave-1.9.1/backend/src/unix/X11InputMonitor.cc.abort 2009-09-18 20:46:22.000000000 +0200
+++ workrave-1.9.1/backend/src/unix/X11InputMonitor.cc 2010-04-26 10:52:13.000000000 +0200
@@ -1,6 +1,6 @@
// X11InputMonitor.cc --- ActivityMonitor for X11
//
-// Copyright (C) 2001-2007, 2009 Rob Caelers <robc at krandor.nl>
+// Copyright (C) 2001-2007, 2009, 2010 Rob Caelers <robc at krandor.nl>
// All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
@@ -77,7 +77,9 @@
using namespace std;
+#ifdef HAVE_XRECORD
int X11InputMonitor::xi_event_base = 0;
+#endif
#ifndef HAVE_APP_GTK
//! Intercepts X11 protocol errors.
@@ -230,27 +232,18 @@ X11InputMonitor::run_events()
{
TRACE_ENTER("X11InputMonitor::run_events");
+ error_trap_enter();
+
root_window = DefaultRootWindow(x11_display);
-
set_all_events(root_window);
-#ifdef HAVE_APP_GTK
- gdk_error_trap_push();
-#else
- int (*old_handler)(Display *dpy, XErrorEvent *error);
- old_handler = XSetErrorHandler(&errorHandler);
-#endif
-
XGrabButton(x11_display, AnyButton, AnyModifier, root_window, True,
ButtonPressMask, GrabModeSync, GrabModeAsync, None, None);
XSync(x11_display,False);
-#ifdef HAVE_APP_GTK
- gdk_error_trap_pop();
-#else
- XSetErrorHandler(old_handler);
-#endif
+ error_trap_exit();
+
Window lastMouseRoot = 0;
while (1)
{
@@ -265,6 +258,8 @@ X11InputMonitor::run_events()
if (gotEvent)
{
+ error_trap_enter();
+
switch (event.xany.type)
{
case KeyPress:
@@ -280,15 +275,22 @@ X11InputMonitor::run_events()
handle_button(&event);
break;
}
+
+ error_trap_exit();
}
+
// timeout
Window root, child;
int root_x, root_y, win_x, win_y;
unsigned mask;
+ error_trap_enter();
+
XQueryPointer(x11_display, root_window, &root, &child, &root_x, &root_y, &win_x, &win_y, &mask);
+ error_trap_exit();
+
lastMouseRoot = root;
fire_mouse(root_x, root_y);
}
@@ -342,22 +344,12 @@ X11InputMonitor::set_event_mask(Window w
void
X11InputMonitor::set_all_events(Window window)
{
-
-#ifdef HAVE_APP_GTK
- gdk_error_trap_push();
-#else
- int (*old_handler)(Display *dpy, XErrorEvent *error);
- old_handler = XSetErrorHandler(&errorHandler);
-#endif
-
+ error_trap_enter();
+
set_event_mask(window);
XSync(x11_display,False);
-#ifdef HAVE_APP_GTK
- gdk_error_trap_pop();
-#else
- XSetErrorHandler(old_handler);
-#endif
+ error_trap_exit();
}
@@ -400,7 +392,28 @@ X11InputMonitor::handle_button(XEvent *e
}
}
+void
+X11InputMonitor::error_trap_enter()
+{
+#ifdef HAVE_APP_GTK
+ gdk_error_trap_push();
+#else
+ int (*old_handler)(Display *dpy, XErrorEvent *error);
+ old_handler = XSetErrorHandler(&errorHandler);
+#endif
+}
+void
+X11InputMonitor::error_trap_exit()
+{
+#ifdef HAVE_APP_GTK
+ gdk_flush ();
+ gdk_error_trap_pop();
+#else
+ XSetErrorHandler(old_handler);
+#endif
+}
+
#ifdef HAVE_XRECORD
diff -up workrave-1.9.1/backend/src/unix/X11InputMonitor.hh.abort workrave-1.9.1/backend/src/unix/X11InputMonitor.hh
--- workrave-1.9.1/backend/src/unix/X11InputMonitor.hh.abort 2009-05-28 21:04:02.000000000 +0200
+++ workrave-1.9.1/backend/src/unix/X11InputMonitor.hh 2010-04-26 10:31:50.000000000 +0200
@@ -1,6 +1,6 @@
// X11InputMonitor.hh --- ActivityMonitor for X11
//
-// Copyright (C) 2001, 2002, 2003, 2006, 2007, 2008, 2009 Rob Caelers <robc at krandor.nl>
+// Copyright (C) 2001, 2002, 2003, 2006, 2007, 2008, 2009, 2010 Rob Caelers <robc at krandor.nl>
// All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
@@ -60,6 +60,9 @@ private:
//! the events execution thread.
void run_events();
+ void error_trap_enter();
+ void error_trap_exit();
+
#ifdef HAVE_XRECORD
//! Initialize
bool init_xrecord();
diff -up workrave-1.9.1/configure.abort workrave-1.9.1/configure
--- workrave-1.9.1/configure.abort 2009-10-25 12:15:06.000000000 +0100
+++ workrave-1.9.1/configure 2010-04-26 10:38:10.000000000 +0200
@@ -29896,7 +29896,7 @@ $as_echo "#define HAVE_GNET2 /**/" >>con
fi
HAVE_APP_GTK=
-if test "x$GTKMM_LIBS" != "x"; then
+if test "x$GTK_LIBS" != "x"; then
$as_echo "#define HAVE_APP_GTK /**/" >>confdefs.h
diff -up workrave-1.9.1/configure.ac.abort workrave-1.9.1/configure.ac
--- workrave-1.9.1/configure.ac.abort 2009-10-24 10:12:32.000000000 +0200
+++ workrave-1.9.1/configure.ac 2010-04-26 10:31:50.000000000 +0200
@@ -663,7 +663,7 @@ if test "x$GNET2" != "x"; then
fi
HAVE_APP_GTK=
-if test "x$GTKMM_LIBS" != "x"; then
+if test "x$GTK_LIBS" != "x"; then
AC_DEFINE(HAVE_APP_GTK,,[Define if Gtk is available])
fi
workrave-1.9.1-compile.patch:
gtkmm/src/gnome_applet/Makefile.in | 2 +-
plugin/exercises/gtkmm/src/ExercisesPanel.cc | 2 +-
plugin/exercises/gtkmm/src/ExercisesPanel.hh | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--- NEW FILE workrave-1.9.1-compile.patch ---
diff -up workrave-1.9.1/frontend/gtkmm/src/gnome_applet/Makefile.in.compile workrave-1.9.1/frontend/gtkmm/src/gnome_applet/Makefile.in
--- workrave-1.9.1/frontend/gtkmm/src/gnome_applet/Makefile.in.compile 2009-10-25 12:15:02.000000000 +0100
+++ workrave-1.9.1/frontend/gtkmm/src/gnome_applet/Makefile.in 2010-03-17 23:35:53.000000000 +0100
@@ -490,7 +490,7 @@ SUBDIRS =
@HAVE_GNOMEAPPLET_TRUE@ -DGNOMELOCALEDIR="\"$(datadir)/locale\""
@HAVE_GNOMEAPPLET_TRUE at workrave_applet_SOURCES = WorkraveApplet.c
- at HAVE_GNOMEAPPLET_TRUE@workrave_applet_LDADD = @GNOME_LIBS@
+ at HAVE_GNOMEAPPLET_TRUE@workrave_applet_LDADD = @GNOME_LIBS@ @DBUS_LIBS@
@HAVE_GNOMEAPPLET_TRUE at workrave_applet_CXXFLAGS = ${FLAGS}
@HAVE_GNOMEAPPLET_TRUE at workrave_applet_CFLAGS = ${FLAGS}
@HAVE_GNOMEAPPLET_TRUE at BUILT_SOURCES = applet-server-bindings.h applet-client-bindings.h gui-client-bindings.h
diff -up workrave-1.9.1/frontend/plugin/exercises/gtkmm/src/ExercisesPanel.cc.compile workrave-1.9.1/frontend/plugin/exercises/gtkmm/src/ExercisesPanel.cc
--- workrave-1.9.1/frontend/plugin/exercises/gtkmm/src/ExercisesPanel.cc.compile 2009-09-18 20:46:22.000000000 +0200
+++ workrave-1.9.1/frontend/plugin/exercises/gtkmm/src/ExercisesPanel.cc 2010-03-17 22:45:49.000000000 +0100
@@ -210,7 +210,7 @@ text_buffer_set_markup (GtkTextBuffer *b
int ExercisesPanel::exercises_pointer = 0;
-ExercisesPanel::ExercisesPanel(Gtk::HButtonBox *dialog_action_area)
+ExercisesPanel::ExercisesPanel(Gtk::ButtonBox *dialog_action_area)
: Gtk::HBox(false, 6),
exercises(Exercise::get_exercises())
{
diff -up workrave-1.9.1/frontend/plugin/exercises/gtkmm/src/ExercisesPanel.hh.compile workrave-1.9.1/frontend/plugin/exercises/gtkmm/src/ExercisesPanel.hh
--- workrave-1.9.1/frontend/plugin/exercises/gtkmm/src/ExercisesPanel.hh.compile 2009-05-28 21:04:02.000000000 +0200
+++ workrave-1.9.1/frontend/plugin/exercises/gtkmm/src/ExercisesPanel.hh 2010-03-17 22:46:01.000000000 +0100
@@ -43,7 +43,7 @@
class ExercisesPanel : public Gtk::HBox
{
public:
- ExercisesPanel(Gtk::HButtonBox *dialog_action_area);
+ ExercisesPanel(Gtk::ButtonBox *dialog_action_area);
~ExercisesPanel();
void set_exercise_count(int num);
More information about the scm-commits
mailing list