diff --git a/ede-panel/Netwm.cpp b/ede-panel/Netwm.cpp index bf6d084..ac69edb 100644 --- a/ede-panel/Netwm.cpp +++ b/ede-panel/Netwm.cpp @@ -93,7 +93,7 @@ static int xevent_handler(int e) { if(fl_xevent->type == PropertyNotify) { int action = -1; - E_DEBUG("==> %s\n", XGetAtomName(fl_display, fl_xevent->xproperty.atom)); + /* E_DEBUG("==> %s\n", XGetAtomName(fl_display, fl_xevent->xproperty.atom)); */ if(fl_xevent->xproperty.atom == _XA_NET_NUMBER_OF_DESKTOPS) action = NETWM_CHANGED_WORKSPACE_COUNT; diff --git a/ede-panel/Panel.cpp b/ede-panel/Panel.cpp index 24f7a6e..e8f71eb 100644 --- a/ede-panel/Panel.cpp +++ b/ede-panel/Panel.cpp @@ -1,6 +1,8 @@ +#include #include #include #include +#include #include #include @@ -34,6 +36,33 @@ EDELIB_NS_USING(build_filename) typedef list WidgetList; typedef list::iterator WidgetListIt; +static int xerror_handler(Display *d, XErrorEvent *e) { + if(e->request_code == X_GetImage) + return 0; + + char buf[128]; + + /* + * construct the similar message format like X11 is using by default, but again, little + * bit different so we knows it comes from here + */ + + sprintf(buf, "%d", e->request_code); + + XGetErrorDatabaseText(d, "XRequest", buf, "%d", buf, sizeof(buf)); + fprintf(stderr, "%s: ", buf); + + XGetErrorText(d, e->error_code, buf, sizeof(buf)); + fprintf(stderr, "%s\n", buf); + + XGetErrorDatabaseText(d, "XlibMessage", "ResourceID", "%d", buf, sizeof(buf)); + fprintf(stderr, " "); + fprintf(stderr, buf, e->resourceid); + fprintf(stderr, "\n"); + + return 0; +} + inline bool intersects(Fl_Widget *o1, Fl_Widget *o2) { return (MAX(o1->x(), o2->x()) <= MIN(o1->x() + o1->w(), o2->x() + o2->w()) && MAX(o1->y(), o2->y()) <= MIN(o1->y() + o1->h(), o2->y() + o2->h())); @@ -240,6 +269,12 @@ void Panel::show(void) { fl_open_display(); + /* + * hush known FLTK bug with XGetImage; a lot of errors will be print when menu icons goes + * outside screen; this also make ede-panel, at some point, unresponsible + */ + XSetErrorHandler((XErrorHandler) xerror_handler); + /* position it */ if(!netwm_get_workarea(X, Y, W, H)) Fl::screen_xywh(X, Y, W, H); diff --git a/ede-panel/applets/taskbar/Taskbar.cpp b/ede-panel/applets/taskbar/Taskbar.cpp index d8cac7d..a1f2b7c 100644 --- a/ede-panel/applets/taskbar/Taskbar.cpp +++ b/ede-panel/applets/taskbar/Taskbar.cpp @@ -82,7 +82,6 @@ void Taskbar::create_task_buttons(void) { for(int i = 0; i < nwins; i++) { if(!netwm_manageable_window(wins[i])) continue; - /* * show window per workspace * TODO: allow showing all windows in each workspace