ignored fullscreen clients' configure requests, answered wm_change_state with normal state, republished net_wm_state after state requests and rechecked fullscreen rules on title change
Browse files
+10 −2 src/wm/handlers.zig
| @@ -74,6 +74,10 @@ fn handleConfigureRequest(event: *xlib.XConfigureRequestEvent, wm: *WindowManage | ||
| 74 | 74 | const client = client_mod.windowToClient(wm.monitors, event.window); |
| 75 | 75 | |
| 76 | 76 | if (client) |managed_client| { |
| 77 | + if (managed_client.is_fullscreen) { | |
| 78 | + tiling.sendConfigure(managed_client); | |
| 79 | + return; | |
| 80 | + } | |
| 77 | 81 | if ((event.value_mask & xlib.c.CWBorderWidth) != 0) { |
| 78 | 82 | managed_client.border_width = event.border_width; |
| 79 | 83 | } else if (managed_client.is_floating or (managed_client.monitor != null and managed_client.monitor.?.lt[managed_client.monitor.?.sel_lt] == null)) { |
| @@ -318,6 +322,9 @@ fn handleClientMessage(event: *xlib.XClientMessageEvent, wm: *WindowManager) voi | ||
| 318 | 322 | core.setFullscreen(client, !client.is_fullscreen, wm); |
| 319 | 323 | } |
| 320 | 324 | } |
| 325 | + core.publishNetWmState(client, wm); | |
| 326 | + } else if (event.message_type == wm.atoms.wm_change_state) { | |
| 327 | + core.setClientState(client, core.NormalState, wm); | |
| 321 | 328 | } else if (event.message_type == wm.atoms.net_active_window) { |
| 322 | 329 | const selected = wm.selected_monitor orelse return; |
| 323 | 330 | if (client != selected.sel and !client.is_urgent) { |
| @@ -336,7 +343,7 @@ fn handleDestroyNotify(event: *xlib.XDestroyWindowEvent, wm: *WindowManager) voi | ||
| 336 | 343 | |
| 337 | 344 | const client = client_mod.windowToClient(wm.monitors, event.window) orelse return; |
| 338 | 345 | std.debug.print("destroy_notify: window=0x{x}\n", .{event.window}); |
| 339 | - core.unmanage(client, wm); | |
| 346 | + core.unmanage(client, true, wm); | |
| 340 | 347 | } |
| 341 | 348 | |
| 342 | 349 | fn handleUnmapNotify(event: *xlib.XUnmapEvent, wm: *WindowManager) void { |
| @@ -349,7 +356,7 @@ fn handleUnmapNotify(event: *xlib.XUnmapEvent, wm: *WindowManager) void { | ||
| 349 | 356 | |
| 350 | 357 | const client = client_mod.windowToClient(wm.monitors, event.window) orelse return; |
| 351 | 358 | std.debug.print("unmap_notify: window=0x{x}\n", .{event.window}); |
| 352 | - core.unmanage(client, wm); | |
| 359 | + core.unmanage(client, false, wm); | |
| 353 | 360 | } |
| 354 | 361 | |
| 355 | 362 | fn handleEnterNotify(event: *xlib.XCrossingEvent, wm: *WindowManager) void { |
| @@ -430,6 +437,7 @@ fn handlePropertyNotify(event: *xlib.XPropertyEvent, wm: *WindowManager) void { | ||
| 430 | 437 | wm.invalidateBars(); |
| 431 | 438 | } else if (event.atom == xlib.XA_WM_NAME or event.atom == wm.atoms.net_wm_name) { |
| 432 | 439 | core.updateTitle(client, wm); |
| 440 | + core.applyFullscreenRule(client, wm); | |
| 433 | 441 | } else if (event.atom == wm.atoms.net_wm_window_type) { |
| 434 | 442 | core.updateWindowType(client, wm); |
| 435 | 443 | } |