Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

merge

  • Loading branch information...
commit b38a159f4fb44a972958d905d93a8be1b50379e8 1 parent 57679b6
@onli authored
Showing with 26 additions and 3 deletions.
  1. +1 −1  src/main.h
  2. +1 −1  src/main_arguments.cc
  3. +24 −1 src/xstuff.cc
View
2  src/main.h
@@ -64,7 +64,7 @@ class simSettings;
class MyApp;
WX_DEFINE_ARRAY (simImage *, ImagesArray);
-#define SIMDOCK_VERSION "1.2.5"
+#define SIMDOCK_VERSION "1.2.6"
#define SIMDOCK_WEBSITE "http://sourceforge.net/projects/simdock"
//#define SIMDOCK_DEBUG
//#define SIMDOCK_DEBUG_ICON_POSITIONING //this is very verbose
View
2  src/main_arguments.cc
@@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "main.h"
-#define SIMDOCK_INFOS "SimDock " SIMDOCK_VERSION " version by Simone Della Longa\nYou can add new programs to the list editing the file ~/.simdock/settings.xml"
+#define SIMDOCK_INFOS "SimDock " SIMDOCK_VERSION " by Simone Della Longa, Malte Paskuda\nYou can add new programs to the list editing the file ~/.simdock/settings.xml"
using namespace std;
void
View
25 src/xstuff.cc
@@ -18,6 +18,8 @@
#include "xstuff.h"
#include "main.h"
+static int (*old_error_handler)(Display *, XErrorEvent *) = NULL;
+
static int client_msg(Display *disp, Window win, char *msg,
unsigned long data0, unsigned long data1,
unsigned long data2, unsigned long data3,
@@ -56,6 +58,18 @@ void xstuff_raiseWindow(Window winID)
XCloseDisplay (dpy);
}
+
+int ignore_bad_window(Display *d, XErrorEvent *e)
+{
+ /* Ignore bad window errors here, handle elsewhere */
+ if (e->error_code != BadWindow) {
+ assert(old_error_handler);
+ (*old_error_handler)(d, e);
+ }
+
+ return 0;
+}
+
unsigned int xstuff_getWindowPID(Window w)
{
Atom atom,actual_type;
@@ -71,13 +85,22 @@ unsigned int xstuff_getWindowPID(Window w)
atom = XInternAtom(dpy, "_NET_WM_PID", True);
atom_name = XGetAtomName (dpy,atom);
-
+
+ /* from http://www.oreillynet.com/linux/blog/2007/10/where_does_my_time_go.html
+ * ignore bad window here because it get raised always when
+ * closing multiple windows, from tasks_window_closed
+ * */
+ old_error_handler = XSetErrorHandler(ignore_bad_window);
+
status = XGetWindowProperty(dpy, w, atom, 0, 1024,
False, AnyPropertyType,
&actual_type,
&actual_format, &nitems,
&bytes_after,
&prop);
+
+ XSetErrorHandler(old_error_handler);
+
if (status!=0 || !prop)
{
return 0;
Please sign in to comment.
Something went wrong with that request. Please try again.