#include "debug.h"
#include "startupnotify.h"
#include "dock.h"
-#include "xerror.h"
#include "screen.h"
#include "moveresize.h"
+#include "ping.h"
#include "place.h"
#include "prop.h"
-#include "extensions.h"
#include "frame.h"
#include "session.h"
#include "event.h"
#include "mouse.h"
#include "render/render.h"
#include "gettext.h"
+#include "obt/display.h"
#ifdef HAVE_UNISTD_H
# include <unistd.h>
static void client_get_shaped(ObClient *self);
static void client_get_mwm_hints(ObClient *self);
static void client_get_colormap(ObClient *self);
+static void client_set_desktop_recursive(ObClient *self,
+ guint target,
+ gboolean donthide,
+ gboolean dontraise);
static void client_change_allowed_actions(ObClient *self);
static void client_change_state(ObClient *self);
static void client_change_wm_state(ObClient *self);
/* watch for when the application stops responding. only do this for
normal windows, i.e. windows which have titlebars and close buttons
- and things like that */
+ and things like that.
+ we don't need to stop pinging on unmanage, because it will be handled
+ automatically by the destroy callback!
+ */
if (self->ping && client_normal(self))
ping_start(self, client_ping_event);
/* remove the window from our save set */
XChangeSaveSet(ob_display, self->window, SetModeDelete);
- /* stop pinging the window */
- if (self->ping && client_normal(self))
- ping_stop(self);
-
/* update the focus lists */
focus_order_remove(self);
if (client_focused(self)) {
{
self->shaped = FALSE;
#ifdef SHAPE
- if (extensions_shape) {
+ if (obt_display_extension_shape) {
gint foo;
guint ufoo;
gint s;
}
#endif
-void client_get_colormap(ObClient *self)
+static void client_get_colormap(ObClient *self)
{
XWindowAttributes wa;
if (hints->flags & IconPixmapHint) {
self->nicons = 1;
self->icons = g_new(ObClientIcon, self->nicons);
- xerror_set_ignore(TRUE);
+ obt_display_ignore_errors(ob_display, TRUE);
if (!RrPixmapToRGBA(ob_rr_inst,
hints->icon_pixmap,
(hints->flags & IconMaskHint ?
g_free(self->icons);
self->nicons = 0;
}
- xerror_set_ignore(FALSE);
+ obt_display_ignore_errors(ob_display, FALSE);
}
XFree(hints);
}
client_update_title(self);
if (!dead) {
- /* the window has started responding again, so don't kill it the first
- time they click on close, even if it stops responding again in the
- future */
- self->close_tried_destroy = FALSE;
+ /* try kill it nicely the first time again, if it started responding
+ at some point */
self->close_tried_term = FALSE;
}
}
/* don't use client_kill(), we should only kill based on PID in
response to a lack of PING replies */
XKillClient(ob_display, self->window);
- else if (self->not_responding && self->close_tried_destroy)
+ else if (self->not_responding)
client_kill(self);
- else {
+ else
+ /* request the client to close with WM_DELETE_WINDOW */
PROP_MSG_TO(self->window, self->window, wm_protocols,
prop_atoms.wm_delete_window, event_curtime, 0, 0, 0,
NoEventMask);
- self->close_tried_destroy = TRUE;
- self->close_tried_term = FALSE;
- }
}
void client_kill(ObClient *self)
}
}
-void client_set_desktop_recursive(ObClient *self,
- guint target,
- gboolean donthide,
- gboolean dontraise)
+static void client_set_desktop_recursive(ObClient *self,
+ guint target,
+ gboolean donthide,
+ gboolean dontraise)
{
guint old;
GSList *it;
*/
event_cancel_all_key_grabs();
- xerror_set_ignore(TRUE);
- xerror_occured = FALSE;
+ obt_display_ignore_errors(ob_display, TRUE);
if (self->can_focus) {
/* This can cause a BadMatch error with CurrentTime, or if an app
XSendEvent(ob_display, self->window, FALSE, NoEventMask, &ce);
}
- xerror_set_ignore(FALSE);
+ obt_display_ignore_errors(ob_display, FALSE);
- ob_debug_type(OB_DEBUG_FOCUS, "Error focusing? %d\n", xerror_occured);
- return !xerror_occured;
+ ob_debug_type(OB_DEBUG_FOCUS, "Error focusing? %d\n",
+ obt_display_error_occured);
+ return !obt_display_error_occured;
}
static void client_present(ObClient *self, gboolean here, gboolean raise,