@@ -106,25 +106,13 @@ void TilingWindowTree::graft(std::shared_ptr<LeafContainer> const& leaf)
106
106
107
107
bool TilingWindowTree::resize_container (miracle::Direction direction, Container& container)
108
108
{
109
- if (is_active_window_fullscreen)
110
- {
111
- mir::log_warning (" Unable to resize the next window: fullscreened" );
112
- return false ;
113
- }
114
-
115
109
handle_resize (container, direction, config->get_resize_jump ());
116
110
return true ;
117
111
}
118
112
119
113
bool TilingWindowTree::select_next (
120
114
miracle::Direction direction, Container& container)
121
115
{
122
- if (is_active_window_fullscreen)
123
- {
124
- mir::log_warning (" Unable to select the next window: fullscreened" );
125
- return false ;
126
- }
127
-
128
116
auto node = handle_select (container, direction);
129
117
if (!node)
130
118
{
@@ -138,10 +126,10 @@ bool TilingWindowTree::select_next(
138
126
139
127
bool TilingWindowTree::toggle_fullscreen (LeafContainer& container)
140
128
{
141
- if (is_active_window_fullscreen)
142
- advise_restored_container (container);
143
- else
129
+ if (container.is_fullscreen ())
144
130
advise_fullscreen_container (container);
131
+ else
132
+ advise_restored_container (container);
145
133
return true ;
146
134
}
147
135
@@ -156,27 +144,8 @@ geom::Rectangle TilingWindowTree::get_area() const
156
144
return root_lane->get_logical_area ();
157
145
}
158
146
159
- std::shared_ptr<LeafContainer> TilingWindowTree::select_window_from_point (int x, int y)
160
- {
161
- if (is_active_window_fullscreen)
162
- return active_container ();
163
-
164
- auto node = root_lane->find_where ([&](std::shared_ptr<Container> const & node)
165
- {
166
- return node->is_leaf () && node->get_logical_area ().contains (geom::Point (x, y));
167
- });
168
-
169
- return Container::as_leaf (node);
170
- }
171
-
172
147
bool TilingWindowTree::move_container (miracle::Direction direction, Container& container)
173
148
{
174
- if (is_active_window_fullscreen)
175
- {
176
- mir::log_warning (" Unable to move active window: fullscreen" );
177
- return false ;
178
- }
179
-
180
149
auto traversal_result = handle_move (container, direction);
181
150
switch (traversal_result.traversal_type )
182
151
{
@@ -286,12 +255,6 @@ void TilingWindowTree::toggle_layout(Container& container, bool cycle_thru_all)
286
255
287
256
void TilingWindowTree::handle_layout_scheme (LayoutScheme scheme, Container& container)
288
257
{
289
- if (is_active_window_fullscreen)
290
- {
291
- mir::log_warning (" Unable to handle direction request: fullscreen" );
292
- return ;
293
- }
294
-
295
258
auto parent = container.get_parent ().lock ();
296
259
if (!parent)
297
260
{
@@ -312,21 +275,14 @@ void TilingWindowTree::handle_layout_scheme(LayoutScheme scheme, Container& cont
312
275
313
276
void TilingWindowTree::advise_focus_gained (LeafContainer& container)
314
277
{
315
- if (is_active_window_fullscreen )
278
+ if (container. is_fullscreen () )
316
279
window_controller.raise (container.window ().value ());
317
280
else if (auto const & parent = container.get_parent ().lock ())
318
281
parent->on_focus_gained ();
319
282
}
320
283
321
284
void TilingWindowTree::advise_delete_window (std::shared_ptr<Container> const & container)
322
285
{
323
- auto active = active_container ();
324
- if (active == container)
325
- {
326
- if (is_active_window_fullscreen)
327
- is_active_window_fullscreen = false ;
328
- }
329
-
330
286
auto parent = handle_remove (container);
331
287
parent->commit_changes ();
332
288
}
@@ -650,16 +606,14 @@ bool TilingWindowTree::advise_fullscreen_container(LeafContainer& container)
650
606
auto window = container.window ().value ();
651
607
window_controller.select_active_window (window);
652
608
window_controller.raise (window);
653
- is_active_window_fullscreen = true ;
654
609
return true ;
655
610
}
656
611
657
612
bool TilingWindowTree::advise_restored_container (LeafContainer& container)
658
613
{
659
- auto active = active_container ();
660
- if (active && active->window () == container.window ().value () && is_active_window_fullscreen )
614
+ auto active = state. active ();
615
+ if (active && active->window () == container.window ().value ())
661
616
{
662
- is_active_window_fullscreen = false ;
663
617
container.set_logical_area (container.get_logical_area ());
664
618
container.commit_changes ();
665
619
}
@@ -670,7 +624,7 @@ bool TilingWindowTree::advise_restored_container(LeafContainer& container)
670
624
bool TilingWindowTree::handle_container_ready (LeafContainer& container)
671
625
{
672
626
constrain (container);
673
- if (is_active_window_fullscreen )
627
+ if (state. active () && state. active ()-> is_fullscreen () )
674
628
return true ;
675
629
676
630
auto window = container.window ().value ();
@@ -796,8 +750,3 @@ Workspace* TilingWindowTree::get_workspace() const
796
750
{
797
751
return tree_interface->get_workspace ();
798
752
}
799
-
800
- std::shared_ptr<LeafContainer> TilingWindowTree::active_container () const
801
- {
802
- return Container::as_leaf (state.active ());
803
- }
0 commit comments