Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
onli committed Jul 30, 2012
1 parent 57679b6 commit b38a159
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main_arguments.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 24 additions & 1 deletion src/xstuff.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit b38a159

Please sign in to comment.