Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: alt + grave behavior now implemented alongside alt + tick #3216

Merged
merged 4 commits into from
Feb 8, 2024

Conversation

mattkae
Copy link
Contributor

@mattkae mattkae commented Feb 5, 2024

What's new?

  • I realized that the last PR was going to be messy, as we would have to maintain a tab order for every application and every window.
  • However, I realized that this list was one in the same. Basically, we just keep the order of Windows, and we choose whether or not we are jumping from App to App or from Window to Window within an app
  • So much simpler, less data to keep track of, and easier to read 🪄

@mattkae mattkae requested a review from AlanGriffiths February 5, 2024 21:38
@mattkae mattkae force-pushed the feature/alt-tick-improved branch from 9f85fed to a00a1aa Compare February 5, 2024 22:11
Copy link
Collaborator

@AlanGriffiths AlanGriffiths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not yet reviewed the functionality, but there's a bunch of "housekeeping" that can be cleared away already.

Comment on lines 85 to 88
void advise_new_window(WindowInfo const& app_info) override;

void advise_delete_window(WindowInfo const& app_info) override;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should document when these are introduced.

Suggested change
void advise_new_window(WindowInfo const& app_info) override;
void advise_delete_window(WindowInfo const& app_info) override;
/// \remark Since MirAL 5.0
void advise_new_window(WindowInfo const& app_info) override;
/// \remark Since MirAL 5.0
void advise_delete_window(WindowInfo const& app_info) override;

Comment on lines 164 to 165
/// Check if the provided window can be selected
auto can_select_window(Window const&) const -> bool;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Check if the provided window can be selected
auto can_select_window(Window const&) const -> bool;
/// Check if the provided window can be selected
/// \remark Since MirAL 5.0
auto can_select_window(Window const&) const -> bool;

Comment on lines 96 to 97
// If we delete the selected application, we will try to select the next available one.
if (application == selected.lock())
if (*it == selected)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code no longer agrees wit hthe comment

miral::MinimalWindowManager::advise_new_window*;
non-virtual?thunk?to?miral::MinimalWindowManager::advise_new_window*;
miral::MinimalWindowManager::advise_delete_window*;
non-virtual?thunk?to?miral::MinimalWindowManager::advise_delete_window*;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need a new stanza - we haven't released Miral 5.0 yet. (Just run the regenerate script)

@mattkae mattkae requested a review from AlanGriffiths February 6, 2024 19:08
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 28 lines in your changes are missing coverage. Please review.

Comparison is base (3a751d3) 77.81% compared to head (3f87567) 77.84%.
Report is 10 commits behind head on main.

Files Patch % Lines
src/miral/application_selector.cpp 74.28% 18 Missing ⚠️
src/miral/window_management_trace.cpp 0.00% 6 Missing ⚠️
src/miral/minimal_window_manager.cpp 60.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3216      +/-   ##
==========================================
+ Coverage   77.81%   77.84%   +0.03%     
==========================================
  Files        1072     1072              
  Lines       75072    75154      +82     
==========================================
+ Hits        58415    58503      +88     
+ Misses      16657    16651       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@AlanGriffiths AlanGriffiths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a sensible implementation, and works sensibly in the scenarios I've tried.

However, there don't seem to be enough tests. I'd expect a similar number of new tests for within-app switching as we have existing tests for between-app switching. Am I missing something?

Window active_window;
Window selected;

bool _is_active = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use "_" at the beginning of variables. (I thought the guide said something about this, but I don't see it now.) Anyway, once upon a time some library vendors assumed that the _[A-Z].+ reserved identifiers allowed macros starting with "_". (It is probably no longer an issue, but let's be consistent with the codebase.)

Suggested change
bool _is_active = false;
bool is_active_ = false;

Comment on lines +154 to +155
(c++)"miral::WaylandExtensions::Context::Context()@MIRAL_5.0" 5.0.0
(c++)"miral::WaylandExtensions::Context::~Context()@MIRAL_5.0" 5.0.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh?! (I can't imagine why you're adding this - it should have been there for a long time already.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I regenerated the symbols, it got generated too

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hence the "Huh?!"

@AlanGriffiths AlanGriffiths added this pull request to the merge queue Feb 8, 2024
Merged via the queue into main with commit fce8ce9 Feb 8, 2024
22 of 24 checks passed
@AlanGriffiths AlanGriffiths deleted the feature/alt-tick-improved branch February 8, 2024 11:19
AlanGriffiths added a commit that referenced this pull request Feb 13, 2024
…oved"

This reverts commit fce8ce9, reversing
changes made to 1032aed.
Saviq added a commit that referenced this pull request Feb 15, 2024
…oved"

This reverts commit fce8ce9, reversing
changes made to 1032aed.
@Saviq
Copy link
Collaborator

Saviq commented Feb 15, 2024

@mattkae had to revert this, as it made Frame fail to start up:

Mir fatal error: advise_focus_gained: window was not found in the list
!!! Fatal signal received. Attempting cleanup, but deadlock may occur
Mir fatal error: Unsupported attempt to continue after a fatal signal: SIGABRT
[1]    36090 IOT instruction (core dumped)  ubuntu-frame

EDIT:
--wallpaper=false works around, so whatever the wallpaper client does isn't handled here.

EDIT2:
Ah no, starting a client without the wallpaper results in the same. So it must be Frame's special window management.

@mattkae
Copy link
Contributor Author

mattkae commented Feb 15, 2024

@mattkae had to revert this, as it made Frame fail to start up:

Mir fatal error: advise_focus_gained: window was not found in the list
!!! Fatal signal received. Attempting cleanup, but deadlock may occur
Mir fatal error: Unsupported attempt to continue after a fatal signal: SIGABRT
[1]    36090 IOT instruction (core dumped)  ubuntu-frame

EDIT: --wallpaper=false works around, so whatever the wallpaper client does isn't handled here.

EDIT2: Ah no, starting a client without the wallpaper results in the same. So it must be Frame's special window management.

Ah that is no good! Anything I can do to help on frame's side of things? Spooky that the window was not found in the list... probably not calling a super method?

@AlanGriffiths
Copy link
Collaborator

Ah that is no good! Anything I can do to help on frame's side of things? Spooky that the window was not found in the list... probably not calling a super method?

Maybe you can track that down?

@mattkae
Copy link
Contributor Author

mattkae commented Feb 15, 2024

Ah that is no good! Anything I can do to help on frame's side of things? Spooky that the window was not found in the list... probably not calling a super method?

Maybe you can track that down?

Yup! I'll look into it now

mattkae added a commit that referenced this pull request Feb 15, 2024
github-merge-queue bot pushed a commit that referenced this pull request Feb 15, 2024
Revert "Revert "Merge pull request #3216 from MirServer/feature/alt-t…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants