X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=500562b0423a329e894f8fc6a2f3724978a0557d;hb=ea28a9e7ab6c81547b2730268097c4ad7d814a80;hp=43a2f551f8252d2f5aec58faa2570690ecd4527c;hpb=38bef0a38bf907a54c193ab063b4830788398edc;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 43a2f551..500562b0 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -32,6 +32,7 @@ #include "session.h" #include "event.h" #include "grab.h" +#include "prompt.h" #include "focus.h" #include "stacking.h" #include "openbox.h" @@ -211,13 +212,13 @@ void client_manage_all(void) if (attrib.override_redirect) continue; if (attrib.map_state != IsUnmapped) - client_manage(children[i]); + client_manage(children[i], NULL); } } XFree(children); } -void client_manage(Window window) +void client_manage(Window window, ObPrompt *prompt) { ObClient *self; XEvent e; @@ -269,8 +270,10 @@ void client_manage(Window window) map_time = event_get_server_time(); - /* choose the events we want to receive on the CLIENT window */ - attrib_set.event_mask = CLIENT_EVENTMASK; + /* choose the events we want to receive on the CLIENT window + (ObPrompt windows can request events too) */ + attrib_set.event_mask = CLIENT_EVENTMASK | + (prompt ? prompt->event_mask : 0); attrib_set.do_not_propagate_mask = CLIENT_NOPROPAGATEMASK; XChangeWindowAttributes(ob_display, window, CWEventMask|CWDontPropagate, &attrib_set); @@ -280,6 +283,7 @@ void client_manage(Window window) self = g_new0(ObClient, 1); self->obwin.type = Window_Client; self->window = window; + self->prompt = prompt; /* non-zero defaults */ self->wmstate = WithdrawnState; /* make sure it gets updated first time */ @@ -299,7 +303,8 @@ void client_manage(Window window) /* specify that if we exit, the window should not be destroyed and should be reparented back to root automatically */ - XChangeSaveSet(ob_display, window, SetModeInsert); + if (!self->prompt) + XChangeSaveSet(ob_display, window, SetModeInsert); /* create the decoration frame for the client window */ self->frame = frame_new(self); @@ -700,7 +705,8 @@ void client_unmanage(ObClient *self) mouse_grab_for_client(self, FALSE); /* remove the window from our save set */ - XChangeSaveSet(ob_display, self->window, SetModeDelete); + if (!self->prompt) + XChangeSaveSet(ob_display, self->window, SetModeDelete); /* update the focus lists */ focus_order_remove(self); @@ -844,13 +850,15 @@ static ObAppSettings *client_get_settings_state(ObClient *self) !g_pattern_match(app->name, strlen(self->name), self->name, NULL)) match = FALSE; else if (app->class && - !g_pattern_match(app->class, - strlen(self->class), self->class, NULL)) + !g_pattern_match(app->class, + strlen(self->class), self->class, NULL)) match = FALSE; else if (app->role && !g_pattern_match(app->role, strlen(self->role), self->role, NULL)) match = FALSE; + else if ((signed)app->type >= 0 && app->type != self->type) + match = FALSE; if (match) { ob_debug("Window matching: %s\n", app->name); @@ -3340,6 +3348,11 @@ void client_close(ObClient *self) { if (!(self->functions & OB_CLIENT_FUNC_CLOSE)) return; + if (self->prompt) { + prompt_hide(self->prompt); + return; + } + /* in the case that the client provides no means to requesting that it close, we just kill it */ if (!self->delete_window)