]> git.sur5r.net Git - i3/i3/commitdiff
Merge pull request #3415 from orestisf1993/g_utf8_make_valid
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Fri, 28 Sep 2018 16:00:06 +0000 (18:00 +0200)
committerGitHub <noreply@github.com>
Fri, 28 Sep 2018 16:00:06 +0000 (18:00 +0200)
Check g_utf8_make_valid availability

include/atoms_rest.xmacro
src/con.c
src/handlers.c
testcases/t/242-no-focus.t

index d461dc08a1d0e7dcda554e04184d6010f78438d5..b65a81d8154d09d50e2f6ce643e60ae1b335e9e4 100644 (file)
@@ -17,3 +17,4 @@ xmacro(I3_FLOATING_WINDOW)
 xmacro(_NET_REQUEST_FRAME_EXTENTS)
 xmacro(_NET_FRAME_EXTENTS)
 xmacro(_MOTIF_WM_HINTS)
+xmacro(WM_CHANGE_STATE)
index a620a57106db4866bebaa0219707e404006d4d9c..d50c29be7a64003a92ad9ba0ca6eae330c4deebd 100644 (file)
--- a/src/con.c
+++ b/src/con.c
@@ -936,6 +936,10 @@ int con_num_windows(Con *con) {
         num += con_num_windows(current);
     }
 
+    TAILQ_FOREACH(current, &(con->floating_head), floating_windows) {
+        num += con_num_windows(current);
+    }
+
     return num;
 }
 
index d2232965c0b5c5670fb83e8bff42722d3ecee5a5..2cd45b7978fb4dc95318447b867742c474cf2843 100644 (file)
@@ -806,6 +806,18 @@ static void handle_client_message(xcb_client_message_event_t *event) {
             XCB_ATOM_CARDINAL, 32, 4,
             &r);
         xcb_flush(conn);
+    } else if (event->type == A_WM_CHANGE_STATE) {
+        /* http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.4 */
+        if (event->data.data32[0] == XCB_ICCCM_WM_STATE_ICONIC) {
+            /* For compatiblity reasons, Wine will request iconic state and cannot ensure that the WM has agreed on it;
+             * immediately revert to normal to avoid being stuck in a paused state. */
+            DLOG("Client has requested iconic state, rejecting. (window = %d)\n", event->window);
+            long data[] = {XCB_ICCCM_WM_STATE_NORMAL, XCB_NONE};
+            xcb_change_property(conn, XCB_PROP_MODE_REPLACE, event->window,
+                                A_WM_STATE, A_WM_STATE, 32, 2, data);
+        } else {
+            DLOG("Not handling WM_CHANGE_STATE request. (window = %d, state = %d)\n", event->window, event->data.data32[0]);
+        }
     } else if (event->type == A__NET_CURRENT_DESKTOP) {
         /* This request is used by pagers and bars to change the current
          * desktop likely as a result of some user action. We interpret this as
index 5b507a78d98d2c2f988e5fead0de339773aed7f7..6fd27fe033852a95ce5d57c0510c0cb03b1e7d55 100644 (file)
@@ -68,7 +68,7 @@ is($x->input_focus, $first->id, 'input focus has not changed');
 exit_gracefully($pid);
 
 #####################################################################
-## 3: no_focus doesn't affect the first window opened on a workspace
+# 3: no_focus doesn't affect the first window opened on a workspace
 #####################################################################
 
 $config = <<EOT;
@@ -87,6 +87,13 @@ $first = open_window(wm_class => 'focusme');
 sync_with_i3;
 is($x->input_focus, $first->id, 'input focus has changed');
 
+# Also check that it counts floating windows
+# See issue #3423.
+open_floating_window(wm_class => 'focusme');
+
+sync_with_i3;
+is($x->input_focus, $first->id, 'input focus didn\'t change to floating window');
+
 exit_gracefully($pid);
 
 #####################################################################