]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
commit d9d580e0382 broke kdesktop again, so we have to fix it at an even finer level...
[chaz/openbox] / openbox / client.c
index d088fca61d652eb6f0755cc0a5f72903cb97f010..dd1f5e72b92c8535f1e29516d5f82a1b2ed13f45 100644 (file)
@@ -737,6 +737,7 @@ void client_unmanage(ObClient *self)
     g_free(self->wm_command);
     g_free(self->title);
     g_free(self->icon_title);
+    g_free(self->original_title);
     g_free(self->name);
     g_free(self->class);
     g_free(self->role);
@@ -1892,6 +1893,7 @@ void client_update_title(ObClient *self)
     gchar *visible = NULL;
 
     g_free(self->title);
+    g_free(self->original_title);
 
     /* try netwm */
     if (!OBT_PROP_GETS(self->window, NET_WM_NAME, utf8, &data)) {
@@ -1908,6 +1910,7 @@ void client_update_title(ObClient *self)
                 data = g_strdup("Unnamed Window");
         }
     }
+    self->original_title = g_strdup(data);
 
     if (self->client_machine) {
         visible = g_strdup_printf("%s (%s)", data, self->client_machine);
@@ -2507,6 +2510,10 @@ gboolean client_show(ObClient *self)
     gboolean show = FALSE;
 
     if (client_should_show(self)) {
+        /* replay pending pointer event before showing the window, in case it
+           should be going to something under the window */
+        mouse_replay_pointer();
+
         frame_show(self->frame);
         show = TRUE;
 
@@ -2548,6 +2555,10 @@ gboolean client_hide(ObClient *self)
            so trying to ignore them is futile in case 3 anyways
         */
 
+        /* replay pending pointer event before hiding the window, in case it
+           should be going to the window */
+        mouse_replay_pointer();
+
         frame_hide(self->frame);
         hide = TRUE;
 
@@ -2963,6 +2974,10 @@ void client_configure(ObClient *self, gint x, gint y, gint w, gint h,
         if (!user)
             ignore_start = event_start_ignore_all_enters();
 
+        /* replay pending pointer event before move the window, in case it
+           would change what window gets the event */
+        mouse_replay_pointer();
+
         frame_adjust_area(self->frame, fmoved, fresized, FALSE);
 
         if (!user)
@@ -3306,30 +3321,39 @@ static void client_kill_requested(ObPrompt *p, gint result, gpointer data)
 
 static void client_prompt_kill(ObClient *self)
 {
-    ObPromptAnswer answers[] = {
-        { _("No"), OB_KILL_RESULT_NO },
-        { _("Yes"), OB_KILL_RESULT_YES }
-    };
-    gchar *m;
-
     /* check if we're already prompting */
-    if (self->kill_prompt) return;
+    if (!self->kill_prompt) {
+        ObPromptAnswer answers[] = {
+            { _("No"), OB_KILL_RESULT_NO },
+            { _("Yes"), OB_KILL_RESULT_YES }
+        };
+        gchar *m;
+        const gchar *sig;
+
+        if (self->kill_level == 0)
+            sig = "terminate";
+        else
+            sig = "kill";
 
-    m = g_strdup_printf
-        (_("The window \"%s\" does not seem to be responding.  Do you want to force it to exit?"), self->title);
+        m = g_strdup_printf
+            (_("The window \"%s\" does not seem to be responding.  Do you want to force it to exit by sending the %s signal?"), self->original_title, sig);
 
-    self->kill_prompt = prompt_new(m, answers,
-                                   sizeof(answers)/sizeof(answers[0]),
-                                   OB_KILL_RESULT_NO, /* default = no */
-                                   OB_KILL_RESULT_NO, /* cancel = no */
-                                   client_kill_requested, self);
-    prompt_show(self->kill_prompt, self);
+        self->kill_prompt = prompt_new(m, answers,
+                                       sizeof(answers)/sizeof(answers[0]),
+                                       OB_KILL_RESULT_NO, /* default = no */
+                                       OB_KILL_RESULT_NO, /* cancel = no */
+                                       client_kill_requested, self);
+        g_free(m);
+    }
 
-    g_free(m);
+    prompt_show(self->kill_prompt, self);
 }
 
 void client_kill(ObClient *self)
 {
+    /* don't kill our own windows */
+    if (self->prompt) return;
+
     if (!self->client_machine && self->pid) {
         /* running on the local host */
         if (self->kill_level == 0) {
This page took 0.025574 seconds and 4 git commands to generate.