@@ -418,7 +418,7 @@ class wayfire_scale : public wf::per_output_plugin_instance_t,
418
418
{
419
419
if (view == current_focus_view)
420
420
{
421
- current_focus_view = toplevel_cast (output-> get_active_view ( ));
421
+ current_focus_view = toplevel_cast (wf::get_active_view_for_output (output ));
422
422
}
423
423
424
424
if (view == initial_focus_view)
@@ -498,9 +498,6 @@ class wayfire_scale : public wf::per_output_plugin_instance_t,
498
498
// End scale
499
499
initial_focus_view = nullptr ;
500
500
deactivate ();
501
- select_view (view);
502
-
503
- output->focus_view (view, false );
504
501
break ;
505
502
506
503
case BTN_MIDDLE:
@@ -587,15 +584,16 @@ class wayfire_scale : public wf::per_output_plugin_instance_t,
587
584
588
585
void handle_keyboard_key (wf::seat_t *, wlr_keyboard_key_event ev) override
589
586
{
590
- auto view = toplevel_cast (output-> get_active_view ( ));
587
+ auto view = toplevel_cast (wf::get_active_view_for_output (output ));
591
588
if (!view)
592
589
{
593
590
view = current_focus_view;
594
591
if (view)
595
592
{
596
593
fade_out_all_except (view);
597
594
fade_in (view);
598
- output->focus_view (view, true );
595
+
596
+ wf::get_core ().default_wm ->focus_raise_view (view);
599
597
return ;
600
598
}
601
599
} else if (!scale_data.count (view))
@@ -635,14 +633,14 @@ class wayfire_scale : public wf::per_output_plugin_instance_t,
635
633
case KEY_ENTER:
636
634
deactivate ();
637
635
select_view (current_focus_view);
638
- output-> focus_view (current_focus_view, true );
636
+ wf::get_core (). default_wm -> focus_raise_view (view );
639
637
640
638
return ;
641
639
642
640
case KEY_ESC:
643
641
deactivate ();
644
642
output->wset ()->request_workspace (initial_workspace);
645
- output-> focus_view (initial_focus_view, true );
643
+ wf::get_core (). default_wm -> focus_raise_view (initial_focus_view);
646
644
initial_focus_view = nullptr ;
647
645
648
646
return ;
@@ -682,9 +680,12 @@ class wayfire_scale : public wf::per_output_plugin_instance_t,
682
680
view = find_view_in_grid (next_row, next_col);
683
681
if (view && (current_focus_view != view))
684
682
{
685
- /* view_focused handler will update the view state
686
- * note: this will always unminimize a minimized view */
687
- output->focus_view (view, false );
683
+ fade_out_all_except (view);
684
+ fade_in (view);
685
+ current_focus_view = view;
686
+
687
+ // Update activated state
688
+ wf::get_core ().seat ->focus_view (view);
688
689
}
689
690
}
690
691
@@ -896,7 +897,7 @@ class wayfire_scale : public wf::per_output_plugin_instance_t,
896
897
});
897
898
898
899
current_focus_view = views.empty () ? nullptr : views.front ();
899
- output-> focus_view (current_focus_view, true );
900
+ wf::get_core (). default_wm -> focus_raise_view (current_focus_view);
900
901
}
901
902
}
902
903
@@ -1162,7 +1163,7 @@ class wayfire_scale : public wf::per_output_plugin_instance_t,
1162
1163
{
1163
1164
if (current_focus_view)
1164
1165
{
1165
- output-> focus_view (current_focus_view, true );
1166
+ wf::get_core (). default_wm -> focus_raise_view (current_focus_view);
1166
1167
}
1167
1168
1168
1169
layout_slots (get_views ());
@@ -1202,20 +1203,12 @@ class wayfire_scale : public wf::per_output_plugin_instance_t,
1202
1203
}
1203
1204
};
1204
1205
1205
- /* View focused. This handler makes sure our view remains focused */
1206
- wf::signal::connection_t <wf::focus_view_signal> view_focused = [=] (wf::focus_view_signal *ev)
1207
- {
1208
- fade_out_all_except (toplevel_cast (ev->view ));
1209
- fade_in (toplevel_cast (ev->view ));
1210
- current_focus_view = toplevel_cast (ev->view );
1211
- };
1212
-
1213
1206
/* Our own refocus that uses untransformed coordinates */
1214
1207
void refocus ()
1215
1208
{
1216
1209
if (current_focus_view)
1217
1210
{
1218
- output-> focus_view (current_focus_view, true );
1211
+ wf::get_core (). default_wm -> focus_raise_view (current_focus_view);
1219
1212
select_view (current_focus_view);
1220
1213
1221
1214
return ;
@@ -1234,7 +1227,7 @@ class wayfire_scale : public wf::per_output_plugin_instance_t,
1234
1227
}
1235
1228
}
1236
1229
1237
- output-> focus_view (next_focus, true );
1230
+ wf::get_core (). default_wm -> focus_raise_view (current_focus_view );
1238
1231
}
1239
1232
1240
1233
/* Returns true if any scale animation is running */
@@ -1340,16 +1333,16 @@ class wayfire_scale : public wf::per_output_plugin_instance_t,
1340
1333
}
1341
1334
1342
1335
initial_workspace = output->wset ()->get_current_workspace ();
1343
- initial_focus_view = toplevel_cast (output-> get_active_view ( ));
1336
+ initial_focus_view = toplevel_cast (wf::get_active_view_for_output (output ));
1344
1337
current_focus_view = initial_focus_view ?: views.front ();
1345
1338
// Make sure no leftover events from the activation binding
1346
1339
// trigger an action in scale
1347
1340
last_selected_view = nullptr ;
1348
1341
1349
1342
grab->grab_input (wf::scene::layer::OVERLAY);
1350
- if (current_focus_view != output ->get_active_view ())
1343
+ if (current_focus_view != wf::get_core (). seat ->get_active_view ())
1351
1344
{
1352
- output-> focus_view (current_focus_view, true );
1345
+ wf::get_core (). default_wm -> focus_raise_view (current_focus_view);
1353
1346
}
1354
1347
1355
1348
active = true ;
@@ -1362,7 +1355,6 @@ class wayfire_scale : public wf::per_output_plugin_instance_t,
1362
1355
output->connect (&view_disappeared);
1363
1356
output->connect (&view_minimized);
1364
1357
output->connect (&view_unmapped);
1365
- output->connect (&view_focused);
1366
1358
1367
1359
fade_out_all_except (current_focus_view);
1368
1360
fade_in (current_focus_view);
@@ -1376,7 +1368,6 @@ class wayfire_scale : public wf::per_output_plugin_instance_t,
1376
1368
active = false ;
1377
1369
1378
1370
set_hook ();
1379
- view_focused.disconnect ();
1380
1371
on_view_mapped.disconnect ();
1381
1372
on_view_set_output.disconnect ();
1382
1373
view_unmapped.disconnect ();
@@ -1433,7 +1424,6 @@ class wayfire_scale : public wf::per_output_plugin_instance_t,
1433
1424
remove_transformers ();
1434
1425
scale_data.clear ();
1435
1426
grab->ungrab_input ();
1436
- view_focused.disconnect ();
1437
1427
on_view_mapped.disconnect ();
1438
1428
on_view_set_output.disconnect ();
1439
1429
view_unmapped.disconnect ();
0 commit comments