Skip to content

Commit 636a7d9

Browse files
committed
toolkit: Do not re-position windows if there is no more output available.
1 parent df409f0 commit 636a7d9

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

doc/ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ See the [Detailed Feature List](FEATURES.md) for details.
5050
* Wire up backlight control to window menu.
5151

5252
* Bug fixes
53-
* Fix crash when changing to different terminal ([#438](https://github.com/phkaeser/wlmaker/issues/438)).
53+
* [done] Fix crash when changing to different terminal ([#438](https://github.com/phkaeser/wlmaker/issues/438)).
5454
* Fix wlmaker not showing window of wlroots clients ([#439](https://github.com/phkaeser/wlmaker/issues/439)).
5555

5656
## [0.7](https://github.com/phkaeser/wlmaker/releases/tag/v0.7)

src/toolkit/workspace.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,12 @@ void _wlmtk_window_reposition_window(
965965
wlmtk_window_t *window_ptr = wlmtk_window_from_dlnode(dlnode_ptr);
966966
wlmtk_workspace_t *workspace_ptr = ud_ptr;
967967

968+
// No re-positioning if extents are zero.
969+
if (workspace_ptr->x1 >= workspace_ptr->x2 ||
970+
workspace_ptr->y1 >= workspace_ptr->y2) {
971+
return;
972+
}
973+
968974
// Fullscreen window? Re-position it. We commit right away, to re-position
969975
// the element.
970976
if (wlmtk_window_is_fullscreen(window_ptr)) {
@@ -1910,6 +1916,13 @@ void test_multi_output_reposition(bs_test_t *test_ptr)
19101916
test_ptr, 400, 0, 236, 186,
19111917
wlmtk_window_get_bounding_box(w3));
19121918

1919+
// Remove the other layout. Extents now 0x0 -- no re-sizing expected.
1920+
wlmtk_util_clear_test_wlr_box_listener(&l1);
1921+
wlmtk_util_clear_test_wlr_box_listener(&l3);
1922+
wlr_output_layout_remove(wlr_output_layout_ptr, &o2);
1923+
BS_TEST_VERIFY_EQ(test_ptr, 0, l1.calls);
1924+
BS_TEST_VERIFY_EQ(test_ptr, 0, l3.calls);
1925+
19131926
wlmtk_workspace_unmap_window(ws_ptr, w3);
19141927
wlmtk_window_destroy(w3);
19151928
wlmtk_element_destroy(&fe3_ptr->element);

0 commit comments

Comments
 (0)