@@ -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