Skip to content

Commit

Permalink
#567 properly cache focused window id upon detection at first space a…
Browse files Browse the repository at this point in the history
…ctivation
  • Loading branch information
koekeishiya committed Jun 11, 2020
1 parent f16f07b commit c7c4abb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Changed
- Re-construct application switched and window created events in the correct order when the window is moved through a rule upon creation [#564](https://github.com/koekeishiya/yabai/issues/564)
- Improve interaction between *window_topmost* and windows that enter native-fullscreen mode [#566](https://github.com/koekeishiya/yabai/issues/566)
- Properly set focused window id cache upon window detection at first space activation [#567](https://github.com/koekeishiya/yabai/issues/567)

## [3.1.2] - 2020-06-09
### Changed
Expand Down
26 changes: 20 additions & 6 deletions src/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,14 +505,14 @@ static EVENT_CALLBACK(EVENT_HANDLER_WINDOW_RESIZED)
window->is_fullscreen = is_fullscreen;

if (!was_fullscreen && is_fullscreen) {
window_manager_make_floating(&g_window_manager, window, false);
border_enter_fullscreen(window);
struct view *view = window_manager_find_managed_window(&g_window_manager, window);
if (view) {
space_manager_untile_window(&g_space_manager, view, window);
window_manager_remove_managed_window(&g_window_manager, window->id);
window_manager_purify_window(&g_window_manager, window);
}
window_manager_make_floating(&g_window_manager, window, false);
} else if (was_fullscreen && !is_fullscreen) {
uint32_t did = window_display_id(window);

Expand All @@ -531,8 +531,8 @@ static EVENT_CALLBACK(EVENT_HANDLER_WINDOW_RESIZED)
struct view *view = space_manager_tile_window_on_space(&g_space_manager, window, window_space(window));
window_manager_add_managed_window(&g_window_manager, window, view);
}
window_manager_make_floating(&g_window_manager, window, window->is_floating);
border_exit_fullscreen(window);
window_manager_make_floating(&g_window_manager, window, window->is_floating);
} else if (was_fullscreen == is_fullscreen) {
if (g_mouse_state.current_action == MOUSE_MODE_MOVE && g_mouse_state.window == window) {
g_mouse_state.window_frame.size = window_ax_frame(g_mouse_state.window).size;
Expand Down Expand Up @@ -637,10 +637,17 @@ static EVENT_CALLBACK(EVENT_HANDLER_SPACE_CHANGED)
window_manager_set_window_opacity(&g_window_manager, focused_window, g_window_manager.active_window_opacity);
border_activate(focused_window);

if (g_mouse_state.ffm_window_id != focused_window->id) {
window_manager_center_mouse(&g_window_manager, focused_window);
if (g_window_manager.focused_window_id != focused_window->id) {
if (g_mouse_state.ffm_window_id != focused_window->id) {
window_manager_center_mouse(&g_window_manager, focused_window);
}

g_window_manager.last_window_id = g_window_manager.focused_window_id;
}

g_window_manager.focused_window_id = focused_window->id;
g_window_manager.focused_window_psn = focused_window->application->psn;

g_mouse_state.ffm_window_id = 0;
window_manager_remove_lost_focused_event(&g_window_manager, focused_window->id);
}
Expand Down Expand Up @@ -679,10 +686,17 @@ static EVENT_CALLBACK(EVENT_HANDLER_DISPLAY_CHANGED)
window_manager_set_window_opacity(&g_window_manager, focused_window, g_window_manager.active_window_opacity);
border_activate(focused_window);

if (g_mouse_state.ffm_window_id != focused_window->id) {
window_manager_center_mouse(&g_window_manager, focused_window);
if (g_window_manager.focused_window_id != focused_window->id) {
if (g_mouse_state.ffm_window_id != focused_window->id) {
window_manager_center_mouse(&g_window_manager, focused_window);
}

g_window_manager.last_window_id = g_window_manager.focused_window_id;
}

g_window_manager.focused_window_id = focused_window->id;
g_window_manager.focused_window_psn = focused_window->application->psn;

g_mouse_state.ffm_window_id = 0;
window_manager_remove_lost_focused_event(&g_window_manager, focused_window->id);
}
Expand Down

0 comments on commit c7c4abb

Please sign in to comment.