Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

[C++ Port] focusWindowByDirection (WIP) #387

Closed

Conversation

krshrimali
Copy link

Summary

This PR is along the lines of issue #335. This is currently a work in progress, and I need to set up a VM to test the changes. I'm creating this PR to track the changes, and motivate me to not stop until it's done.

Please feel free to leave any minor changes you have to suggest, however, when I'm going to test, I'll probably fix any bugs with this code.

Breaking Changes

Do your changes intentionally break something on the user side or configuration? No! :)

Test Plan

(TODO) - Probably, check if the keyboard shortcuts work for all different combinations.

Related Issues

Partially fixes #335

cc: @gikari

Comment on lines -7 to -10
- repo: https://github.com/fsfe/reuse-tool
rev: v0.14.0
hooks:
- id: reuse
Copy link
Author

@krshrimali krshrimali Jun 29, 2022

Choose a reason for hiding this comment

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

I was having this error locally: Unfortunately, your project is not compliant with version 3.0 of the REUSE Specification :-(. So I removed it just for now, later when this PR is in the review stage, maybe we can come back to it and help get this back :)

Copy link
Member

Choose a reason for hiding this comment

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

This error means, that some of your files do not contain the license headers like:

// SPDX-FileCopyrightText: 2022 Mikhail Zolotukhin <[email protected]>
// SPDX-License-Identifier: MIT

In general, the reuse tool should show you which exact files should contain similar headers.

Copy link
Author

Choose a reason for hiding this comment

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

Got it, thank you @gikari! :)

@krshrimali krshrimali marked this pull request as draft June 29, 2022 17:08
@@ -18,6 +18,7 @@ Engine::Engine(PlasmaApi::Api &api, const Bismuth::Config &config)
, m_windows(api.workspace())
, m_activeLayouts(config)
, m_plasmaApi(api)
, timestamp(0)
Copy link
Author

Choose a reason for hiding this comment

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

This is a TODO. I think this will require onWindowFocused and hence the signal from QAbstractState - activeChanged.

@gikari
Copy link
Member

gikari commented Jun 30, 2022

I suggest you to start porting not from there, but from layouts logic. This is because what you're doing right now is not testable at the moment, as there are no layouts, that have >1 window in them at the same time.

Layouts logic in legacy Typescript is pretty isolated and self-contained, so it can be relatively easily ported with the addition of auto-tests, that cover their logic.

After one of the layouts is implemented, you can come back here and finish the implementation with the appropriate manual testing.

@krshrimali
Copy link
Author

I suggest you to start porting not from there, but from layouts logic. This is because what you're doing right now is not testable at the moment, as there are no layouts, that have >1 window in them at the same time.

Layouts logic in legacy Typescript is pretty isolated and self-contained, so it can be relatively easily ported with the addition of auto-tests, that cover their logic.

After one of the layouts is implemented, you can come back here and finish the implementation with the appropriate manual testing.

That is an excellent suggestion, @gikari - thank you! I agree, that without one tiling layout ported/implemented, it will be hard to test. I will keep this PR open, and come back to this once a tiling layout is ported. :) Thank you again!

@gikari
Copy link
Member

gikari commented Aug 30, 2022

If you're willing to continue the port, checkout polonium branch. I think it will be beneficial to start from it, if you want to make the C++ port. There are a couple of reasons to it:

  1. You don't have to specify experimentalBackend config option to switch to the new implementation.
  2. The code, that is already present in that branch, defines some basic architecture, that allows to implement some features in the future. For example, Tab Bar for windows or window groups (sublayouts).
  3. There will be breaking changes, so removing all the previous stuff makes it easier to focus on the new shape of the program. The migration scripts could be written before the release.
  4. Configuration window is changed according to the options I want to keep in the new version, so that it helps to shape an MVP (which means old options will be readded if it is really necessary).

There is a WIP implementation of master-stack (ex tile) layout on my local machine, but it does not work and makes kwin crash. I am currently unable to actively develop it, but will try in my free time. Although, I am not sure how much I will have it in the future, because I am currently in the process of changing my country of residence and getting a new full-time job.

@gikari gikari closed this Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DEV]: Port to C++
2 participants