@@ -247,12 +247,12 @@ namespace Gala {
247247 window_switcher = new WindowSwitcher (this );
248248 ui_group. add_child (window_switcher);
249249
250- Meta . KeyBinding . set_custom_handler (" switch-applications" , ( Meta . KeyHandlerFunc ) window_switcher. handle_switch_windows);
251- Meta . KeyBinding . set_custom_handler (" switch-applications-backward" , ( Meta . KeyHandlerFunc ) window_switcher. handle_switch_windows);
252- Meta . KeyBinding . set_custom_handler (" switch-windows" , ( Meta . KeyHandlerFunc ) window_switcher. handle_switch_windows);
253- Meta . KeyBinding . set_custom_handler (" switch-windows-backward" , ( Meta . KeyHandlerFunc ) window_switcher. handle_switch_windows);
254- Meta . KeyBinding . set_custom_handler (" switch-group" , ( Meta . KeyHandlerFunc ) window_switcher. handle_switch_windows);
255- Meta . KeyBinding . set_custom_handler (" switch-group-backward" , ( Meta . KeyHandlerFunc ) window_switcher. handle_switch_windows);
250+ Meta . KeyBinding . set_custom_handler (" switch-applications" , window_switcher. handle_switch_windows);
251+ Meta . KeyBinding . set_custom_handler (" switch-applications-backward" , window_switcher. handle_switch_windows);
252+ Meta . KeyBinding . set_custom_handler (" switch-windows" , window_switcher. handle_switch_windows);
253+ Meta . KeyBinding . set_custom_handler (" switch-windows-backward" , window_switcher. handle_switch_windows);
254+ Meta . KeyBinding . set_custom_handler (" switch-group" , window_switcher. handle_switch_windows);
255+ Meta . KeyBinding . set_custom_handler (" switch-group-backward" , window_switcher. handle_switch_windows);
256256 }
257257
258258 if (plugin_manager. window_overview_provider == null
@@ -288,23 +288,23 @@ namespace Gala {
288288 /* keybindings*/
289289 var keybinding_settings = new GLib .Settings (" io.elementary.desktop.wm.keybindings" );
290290
291- display. add_keybinding (" switch-to-workspace-first" , keybinding_settings, Meta . KeyBindingFlags . IGNORE_AUTOREPEAT , ( Meta . KeyHandlerFunc ) handle_switch_to_workspace_end);
292- display. add_keybinding (" switch-to-workspace-last" , keybinding_settings, Meta . KeyBindingFlags . IGNORE_AUTOREPEAT , ( Meta . KeyHandlerFunc ) handle_switch_to_workspace_end);
293- display. add_keybinding (" move-to-workspace-first" , keybinding_settings, Meta . KeyBindingFlags . IGNORE_AUTOREPEAT , ( Meta . KeyHandlerFunc ) handle_move_to_workspace_end);
294- display. add_keybinding (" move-to-workspace-last" , keybinding_settings, Meta . KeyBindingFlags . IGNORE_AUTOREPEAT , ( Meta . KeyHandlerFunc ) handle_move_to_workspace_end);
295- display. add_keybinding (" cycle-workspaces-next" , keybinding_settings, Meta . KeyBindingFlags . NONE , ( Meta . KeyHandlerFunc ) handle_cycle_workspaces);
296- display. add_keybinding (" cycle-workspaces-previous" , keybinding_settings, Meta . KeyBindingFlags . NONE , ( Meta . KeyHandlerFunc ) handle_cycle_workspaces);
297- display. add_keybinding (" panel-main-menu" , keybinding_settings, Meta . KeyBindingFlags . IGNORE_AUTOREPEAT , ( Meta . KeyHandlerFunc ) handle_applications_menu);
291+ display. add_keybinding (" switch-to-workspace-first" , keybinding_settings, IGNORE_AUTOREPEAT , handle_switch_to_workspace_end);
292+ display. add_keybinding (" switch-to-workspace-last" , keybinding_settings, IGNORE_AUTOREPEAT , handle_switch_to_workspace_end);
293+ display. add_keybinding (" move-to-workspace-first" , keybinding_settings, IGNORE_AUTOREPEAT , handle_move_to_workspace_end);
294+ display. add_keybinding (" move-to-workspace-last" , keybinding_settings, IGNORE_AUTOREPEAT , handle_move_to_workspace_end);
295+ display. add_keybinding (" cycle-workspaces-next" , keybinding_settings, NONE , handle_cycle_workspaces);
296+ display. add_keybinding (" cycle-workspaces-previous" , keybinding_settings, NONE , handle_cycle_workspaces);
297+ display. add_keybinding (" panel-main-menu" , keybinding_settings, IGNORE_AUTOREPEAT , handle_applications_menu);
298298
299- display. add_keybinding (" toggle-multitasking-view" , keybinding_settings, Meta . KeyBindingFlags . IGNORE_AUTOREPEAT , () = > {
299+ display. add_keybinding (" toggle-multitasking-view" , keybinding_settings, IGNORE_AUTOREPEAT , () = > {
300300 if (multitasking_view. is_opened ()) {
301301 multitasking_view. close ();
302302 } else {
303303 multitasking_view. open ();
304304 }
305305 });
306306
307- display. add_keybinding (" expose-all-windows" , keybinding_settings, Meta . KeyBindingFlags . IGNORE_AUTOREPEAT , () = > {
307+ display. add_keybinding (" expose-all-windows" , keybinding_settings, IGNORE_AUTOREPEAT , () = > {
308308 if (window_overview. is_opened ()) {
309309 window_overview. close ();
310310 } else {
@@ -322,17 +322,17 @@ namespace Gala {
322322
323323 Meta . KeyBinding . set_custom_handler (" switch-to-workspace-up" , () = > {});
324324 Meta . KeyBinding . set_custom_handler (" switch-to-workspace-down" , () = > {});
325- Meta . KeyBinding . set_custom_handler (" switch-to-workspace-left" , ( Meta . KeyHandlerFunc ) handle_switch_to_workspace);
326- Meta . KeyBinding . set_custom_handler (" switch-to-workspace-right" , ( Meta . KeyHandlerFunc ) handle_switch_to_workspace);
325+ Meta . KeyBinding . set_custom_handler (" switch-to-workspace-left" , handle_switch_to_workspace);
326+ Meta . KeyBinding . set_custom_handler (" switch-to-workspace-right" , handle_switch_to_workspace);
327327
328328 Meta . KeyBinding . set_custom_handler (" move-to-workspace-up" , () = > {});
329329 Meta . KeyBinding . set_custom_handler (" move-to-workspace-down" , () = > {});
330- Meta . KeyBinding . set_custom_handler (" move-to-workspace-left" , ( Meta . KeyHandlerFunc ) handle_move_to_workspace);
331- Meta . KeyBinding . set_custom_handler (" move-to-workspace-right" , ( Meta . KeyHandlerFunc ) handle_move_to_workspace);
330+ Meta . KeyBinding . set_custom_handler (" move-to-workspace-left" , handle_move_to_workspace);
331+ Meta . KeyBinding . set_custom_handler (" move-to-workspace-right" , handle_move_to_workspace);
332332
333333 for (int i = 1 ; i < 13 ; i++ ) {
334- Meta . KeyBinding . set_custom_handler (" switch-to-workspace-%d " . printf (i), ( Meta . KeyHandlerFunc ) handle_switch_to_workspace);
335- Meta . KeyBinding . set_custom_handler (" move-to-workspace-%d " . printf (i), ( Meta . KeyHandlerFunc ) handle_move_to_workspace);
334+ Meta . KeyBinding . set_custom_handler (" switch-to-workspace-%d " . printf (i), handle_switch_to_workspace);
335+ Meta . KeyBinding . set_custom_handler (" move-to-workspace-%d " . printf (i), handle_move_to_workspace);
336336 }
337337
338338 unowned var monitor_manager = display. get_context (). get_backend (). get_monitor_manager ();
@@ -427,7 +427,7 @@ namespace Gala {
427427 }
428428
429429 [CCode (instance_pos = -1 )]
430- private void handle_cycle_workspaces (Meta .Display display , Meta .Window ? window , Clutter .KeyEvent event ,
430+ private void handle_cycle_workspaces (Meta .Display display , Meta .Window ? window , Clutter .KeyEvent ? event ,
431431 Meta .KeyBinding binding ) {
432432 var direction = (binding. get_name () == " cycle-workspaces-next" ? 1 : - 1 );
433433 unowned var manager = display. get_workspace_manager ();
@@ -441,15 +441,16 @@ namespace Gala {
441441 }
442442
443443 if (active_workspace_index != index) {
444- manager. get_workspace_by_index (index). activate (event. get_time ());
444+ var timestamp = event != null ? event. get_time () : Meta . CURRENT_TIME ;
445+ manager. get_workspace_by_index (index). activate (timestamp);
445446 } else {
446447 InternalUtils . bell_notify (display);
447448 }
448449 }
449450
450451 [CCode (instance_pos = -1 )]
451452 private void handle_move_to_workspace (Meta .Display display , Meta .Window ? window ,
452- Clutter .KeyEvent event , Meta .KeyBinding binding ) {
453+ Clutter .KeyEvent ? event , Meta .KeyBinding binding ) {
453454 if (window == null ) {
454455 return ;
455456 }
@@ -470,31 +471,35 @@ namespace Gala {
470471 }
471472
472473 if (target_workspace != null ) {
473- move_window (window, target_workspace, event. get_time ());
474+ var timestamp = event != null ? event. get_time () : Meta . CURRENT_TIME ;
475+ move_window (window, target_workspace, timestamp);
474476 }
475477 }
476478
477479 [CCode (instance_pos = -1 )]
478480 private void handle_move_to_workspace_end (Meta .Display display , Meta .Window ? window ,
479- Clutter .KeyEvent event , Meta .KeyBinding binding ) {
480- if (window == null )
481+ Clutter .KeyEvent ? event , Meta .KeyBinding binding ) {
482+ if (window == null ) {
481483 return ;
484+ }
482485
486+ var timestamp = event != null ? event. get_time (): Meta . CURRENT_TIME ;
483487 unowned Meta . WorkspaceManager manager = display. get_workspace_manager ();
484488 var index = (binding. get_name () == " move-to-workspace-first" ? 0 : manager. get_n_workspaces () - 1 );
485489 unowned var workspace = manager. get_workspace_by_index (index);
486490 window. change_workspace (workspace);
487- workspace. activate_with_focus (window, event . get_time () );
491+ workspace. activate_with_focus (window, timestamp );
488492 }
489493
490494 [CCode (instance_pos = -1 )]
491495 private void handle_switch_to_workspace (Meta .Display display , Meta .Window ? window ,
492- Clutter .KeyEvent event , Meta .KeyBinding binding ) {
496+ Clutter .KeyEvent ? event , Meta .KeyBinding binding ) {
497+ var timestamp = event != null ? event. get_time () : Meta . CURRENT_TIME ;
493498 unowned var name = binding. get_name ();
494499
495500 if (name == " switch-to-workspace-left" || name == " switch-to-workspace-right" ) {
496501 var direction = (name == " switch-to-workspace-left" ? Meta . MotionDirection . LEFT : Meta . MotionDirection . RIGHT );
497- switch_to_next_workspace (direction, event . get_time () );
502+ switch_to_next_workspace (direction, timestamp );
498503 } else {
499504 unowned var workspace_manager = get_display (). get_workspace_manager ();
500505
@@ -506,21 +511,21 @@ namespace Gala {
506511 return ;
507512 }
508513
509- workspace. activate (event . get_time () );
514+ workspace. activate (timestamp );
510515 }
511516 }
512517
513518 [CCode (instance_pos = -1 )]
514519 private void handle_switch_to_workspace_end (Meta .Display display , Meta .Window ? window ,
515- Clutter .KeyEvent event , Meta .KeyBinding binding ) {
520+ Clutter .KeyEvent ? event , Meta .KeyBinding binding ) {
516521 unowned Meta . WorkspaceManager manager = display. get_workspace_manager ();
517522 var index = (binding. get_name () == " switch-to-workspace-first" ? 0 : manager. n_workspaces - 1 );
518- manager. get_workspace_by_index (index). activate (event. get_time ());
523+ manager. get_workspace_by_index (index). activate (event != null ? event . get_time () : Meta . CURRENT_TIME );
519524 }
520525
521526 [CCode (instance_pos = -1 )]
522527 private void handle_applications_menu (Meta .Display display , Meta .Window ? window ,
523- Clutter .KeyEvent event , Meta .KeyBinding binding ) {
528+ Clutter .KeyEvent ? event , Meta .KeyBinding binding ) {
524529 launch_action (ActionKeys . PANEL_MAIN_MENU_ACTION );
525530 }
526531
0 commit comments