Skip to content

Commit

Permalink
PR feedback changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
tarek-y-ismail committed Dec 9, 2024
1 parent 56714dc commit 072b1a3
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion examples/miral-shell/shell_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <miral/x11_support.h>
#include <miral/wayland_extensions.h>

#include <stdexcept>
#include <xkbcommon/xkbcommon-keysyms.h>

#include <cstring>
Expand Down
1 change: 0 additions & 1 deletion src/miral/application_selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <miral/application.h>
#include <mir/log.h>
#include <mir/scene/session.h>
#include <unordered_set>

using namespace miral;

Expand Down
2 changes: 1 addition & 1 deletion src/miral/basic_window_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void miral::BasicWindowManager::surface_ready(std::shared_ptr<scene::Surface> co
auto window = info_for(surface).window();
auto const top = mru_active_windows.top();
if(top && top != window)
mru_active_windows.push_unfocused(window);
mru_active_windows.insert_below_top(window);
}

void miral::BasicWindowManager::modify_surface(
Expand Down
9 changes: 2 additions & 7 deletions src/miral/minimal_window_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ auto miral::MinimalWindowManager::place_new_window(

void miral::MinimalWindowManager::handle_window_ready(WindowInfo& window_info)
{
// If focus stealing prevention isn't enabled, activate on window ready (if
// possible). Otherwise, only activate the first opened window.
if (!self->prevent_focus_stealing(window_info) && window_info.can_be_active())
{
tools.select_active_window(window_info.window());
Expand Down Expand Up @@ -299,14 +297,11 @@ auto miral::MinimalWindowManager::confirm_inherited_move(WindowInfo const& windo

void miral::MinimalWindowManager::advise_new_window(miral::WindowInfo const& window_info)
{
// If focus stealing prevention is on, swap the old focused window (now in
// the back) with the new window in the front.
// If the window is prevented from stealing focus, swap the old focused
// window (now in the back) with the new window in the front.
//
// If it's a legitimate window, it'll be focused and raised via
// xdg-activation.
//
// This is limited to a couple of window types, as well as windows in the
// "application" layer that don't have a parent.
auto in_background = self->prevent_focus_stealing(window_info);

self->application_selector.advise_new_window(window_info, in_background);
Expand Down
2 changes: 1 addition & 1 deletion src/miral/mru_window_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void miral::MRUWindowList::push(Window const& window)
windows.push_back(window);
}

void miral::MRUWindowList::push_unfocused(Window const& window)
void miral::MRUWindowList::insert_below_top(Window const& window)
{
windows.erase(remove(begin(windows), end(windows), window), end(windows));
if(!windows.empty())
Expand Down
2 changes: 1 addition & 1 deletion src/miral/mru_window_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MRUWindowList
public:

void push(Window const& window);
void push_unfocused(Window const& window);
void insert_below_top(Window const& window);
void erase(Window const& window);
auto top() const -> Window;

Expand Down

0 comments on commit 072b1a3

Please sign in to comment.