X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=cd26debb5fbff3d5d9c73c1c82e202941da45d34;hb=a5005506a89ecffe13e04cbcda5c20a2fa6ba25d;hp=371eb08746d4b6b172e3353294d2646c950fb4db;hpb=27177e498b737cc351ce446f0b89010bcf29bfcd;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 371eb087..cd26debb 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; @@ -271,6 +272,8 @@ void client_manage(Window window) /* choose the events we want to receive on the CLIENT window */ attrib_set.event_mask = CLIENT_EVENTMASK; + if (prompt) + attrib_set.event_mask |= KeyPressMask; 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); @@ -3342,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)