Skip to content

Wayfire backend #2280

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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

marcusbritanicus
Copy link
Contributor

@marcusbritanicus marcusbritanicus commented May 13, 2025

What works

  • Listing tasks
  • Listing tasks per workspace
  • Moving windows from one workspace to another (menu)
  • Closing a view (menu and close button)
  • Minimizing and restoring a view (menu)
  • Maximizing/restoring a view (menu)
  • Listing workspaces
  • Switching workspaces
  • Show/hide Desktop
  • Send to previous/next monitor - I am not very sure how LXQt identified "previous" or "next".

What does not work, but can (eventually 😉)

  • Proper minimize/restore using task button - requires double clicks
  • Pin to top/bottom - unimplemented from my side (currently)
  • Workspace names (LXQt support missing) - Since workspaces on wayfire are per-output, workspace names too are per-output. This means that we need to provide the output name when calling the getyWorkspaceName(...) function. I lack the proper knowledge to make this work. @tsujan Perhaps, you can have a look?
  • Vertical/Horizontal maximize (No support from Wayfire, I am working on it)

What should work, but does not.

Unsupported

  • Shade/Roll-up
  • Urgency
  • Pin view below.

All other features are currently untested or not implemented.

@tsujan
Copy link
Member

tsujan commented May 13, 2025

Very nice to have a dedicated backend for wayfire :) Thank you very much for the hard work!

After releasing 2.2.1, I'll try it with git Wayfire and check those of parts of the code that I can check.

@marcusbritanicus
This is very unrelated, but I'll forget it if I don't mention it here ;) Any idea about WayfireWM/wayfire#2600? I think it's a serious obstacle to using Wayfire with Qt.

@stefonarch
Copy link
Member

Can confirm most, nice work :)
It needs Wayfire git+2 PRs atm.

"Show only apps from the panel's screen" works too, maybe it did before too?
"Show only windows from current workspace" doesn't.

@stefonarch
Copy link
Member

Probably the desktop switcher needs a fix as it was never used to show per-screen-workspaces. It should only consider the workspaces of the screen, similar to the setting available in the taskmanager. Atm it works changing workspaces only of the screen but it displays everywhere the same desktop. This is when switching workspaces on another desktop:

swipe.mp4

@marcusbritanicus
Copy link
Contributor Author

Very nice to have a dedicated backend for wayfire :) Thank you very much for the hard work!
Can confirm most, nice work :)

Thank you.

This is very unrelated, but I'll forget it if I don't mention it here ;) Any idea about WayfireWM/wayfire#2600? I think it's a serious obstacle to using Wayfire with Qt.

I'll have a look at this sometime next week.

Probably the desktop switcher needs a fix as it was never used to show per-screen-workspaces. It should only consider the workspaces of the screen, similar to the setting available in the taskmanager. Atm it works changing workspaces only of the screen but it displays everywhere the same desktop. This is when switching workspaces on another desktop:

It's the currentWorkspaceChanged signal that needs to be tracked properly. I have modified this signal to take two arguments, first the workspace index, and second the output name. However, I did not find a proper way to get the screen name in the desktop-switcher plugin, which is why this happens.

"Show only windows from current workspace" doesn't.

This should work, but perhaps some plugin from wayfire is not enabled. Currently, I'm not printing the IPC error messages. Once I add the debug messages, it will be easier to track what's working and what does not.

@stefonarch
Copy link
Member

"Show only windows from current workspace" doesn't.

This should work, but perhaps some plugin from wayfire is not enabled. Currently, I'm not printing the IPC error messages. Once I add the debug messages, it will be easier to track what's working and what does not.

This was before afaik, it works fine now.

What can be seen (if this option is unchecked) moving it by right click to another desktop works, but when I go to another workspace and then try to move it there by right click menu it doesn't. Basically same as "move to current". What's worse is when the view is on 1, I go to 3 and move it to 2 by right click: the view is minimized and can't be activated nowhere by clicking the button, only "maximize" will open it on the current workspace.

@marcusbritanicus
Copy link
Contributor Author

I am missing a few signals from wayfire. For example, I am trying to track the tiled (maximize) signal, but I do not think it is emitted. There are a few other similar issues, I believe. We'll fix it one by one.

@marcusbritanicus
Copy link
Contributor Author

I am missing a few signals from wayfire. For example, I am trying to track the tiled (maximize) signal, but I do not think it is emitted. There are a few other similar issues, I believe. We'll fix it one by one.

Turns out, as usually it does, this was a mistake from my end. The maximize signal is emitted, upon which windowPropertiesChanged(viewId, (int)LXQtTaskBarWindowProperty::State); is emitted. As I understand correctly, once this signal is emitted, getWindowState(viewId) should be called, which I do not see happening. At the moment, I do not know why this is so.

@marcusbritanicus
Copy link
Contributor Author

I am missing a few signals from wayfire. For example, I am trying to track the tiled (maximize) signal, but I do not think it is emitted. There are a few other similar issues, I believe. We'll fix it one by one.

Turns out, as usually it does, this was a mistake from my end. The maximize signal is emitted, upon which windowPropertiesChanged(viewId, (int)LXQtTaskBarWindowProperty::State); is emitted. As I understand correctly, once this signal is emitted, getWindowState(viewId) should be called, which I do not see happening. At the moment, I do not know why this is so.

Again, this was my mistake. Fixed maximize and restore.

@marcusbritanicus
Copy link
Contributor Author

This PR is now ready for review, with one outstanding issue:
Minimize/Restore by clicking on the Task Button does not work as intended.

@tsujan @gfgit I kindly request you both to have a look at my code and suggest if something is amiss. I also request you to help me figure out how we can get the screen names in the desktop switcher plugin.

@stefonarch Feel free to test various scenarios. Please let me know if there is some feature that does not work.

@tsujan
Copy link
Member

tsujan commented May 19, 2025

Yesterday I had time to test it (and, of course, I'll test it again later) and saw some problems:

  • If I opened LXQt file dialog from FeatherPad, it couldn't be minimized by its task-button, but strangely, Show Desktop worked on it.
  • If I switched desktop, all windows that were minimized by Show Desktop were suddenly restored.
  • All windows minimized by Show Desktop were restored if I launched any GUI app.
  • Windows couldn't be moved to other desktops by using their task buttons.

Sorry, I was extremely busy with coding (now too) and so, my tests were short. Also, I don't know if they're fixed by a recent commit of yours or not. I had the latest git wayfire, without an additional patch, so I don't know whether a patch was needed.

@tsujan
Copy link
Member

tsujan commented May 19, 2025

As for the code, I might find and fix problems after merging whenever I encounter them. I did so with both kwin_wayland and wlroots backends. But honestly, due to problems like WayfireWM/wayfire#2600, I'm not sure that I could spend enough time on wayfire.

@marcusbritanicus
Copy link
Contributor Author

If I opened LXQt file dialog from FeatherPad, it couldn't be minimized by its task-button, but strangely, Show Desktop worked on it.

You cannot "minimize" a dialog. Ideally, minimizing a dialog should minimize the whole application. Am I right in assuming that this is where "Transient Windows" concept comes?

If I switched desktop, all windows that were minimized by Show Desktop were suddenly restored.

This is by design (Wayfire design) and not a bug.

All windows minimized by Show Desktop were restored if I launched any GUI app.

Again by design, and not a bug.

Windows couldn't be moved to other desktops by using their task buttons.

I do not know where the code for this resides, but I have a feeling that we'll need to get the screen name for this as well.

But honestly, due to problems like WayfireWM/wayfire#2600, I'm not sure that I could spend enough time on wayfire.

Since I hardly use a menu for cut/copy/paste, I would have never noticed it at all. But let's get it resolved soon.

@tsujan
Copy link
Member

tsujan commented May 19, 2025

You cannot "minimize" a dialog.

Modal dialogs are minimized with their parent windows under labwc. Recently, I corrected some problems about it in our kwin_wayland backend. All in all, this is the expected behavior, IMO.

This is by design (Wayfire design) and not a bug.

Then it's a very bad design, as it's usual with wayfire. Sorry, I prefer to be honest about wayfire's flaws, because I've seen lots of them through years.

Again by design, and not a bug.

Worse ;)

I do not know where the code for this resides…

That's OK. It could be done after merging, whenever it's doable.

@stefonarch
Copy link
Member

Glad to retest, recently moving views to workspaces was broken afaik.

@stefonarch
Copy link
Member

stefonarch commented May 19, 2025

Modal dialogs are minimized with their parent windows under labwc.

Dialogs are minimized and restored here with the widget (there is also a shortcut afaik). Qterminal with preferences and font dialog as well, only the font dialog gets under the preferences dialog when restored.

Edit: oh, you meant directly minimizing dialogs.

@stefonarch
Copy link
Member

stefonarch commented May 19, 2025

My findings:

  1. Move a view to next monitor by taskbar menu item: it appears on the monitor's taskbar only after a move of the view.
  2. "move to workspace" from taskbar menu is broken here (all desktops is working). Am I missing something? It worked before "all desktop" was added.
  3. panel can't be restarted from the session settings (needs alt+k in qps to really stop it)
  4. After "maximize" > restore is not available, still "maximize" active.
  5. Dialogs have no minimize buttons but in the taskbar it can be done, they minimize and restore immediately.

Sometimes 2 windows are marked as active, not sure how I triggered it.

@marcusbritanicus
Copy link
Contributor Author

Move a view to next monitor by taskbar menu item: it appears on the monitor's taskbar only after a move of the view.

Yes, this is a wayfire bug. I have to discuss with @ammen99. For some reason, wayfire ends up emitting "unmap" on that view, and does not emit a "mapped" signal.

"move to workspace" from taskbar menu is broken here (all desktops is working). Am I missing something? It worked before "all desktop" was added.

It works properly on my system, it seems. I'll add a few more debug outputs and then if you give me the output, I'll be able to pinpoint why.. (hopefully)

After "maximize" > restore is not available, still "maximize" active.

This, AFAIK, I fixed in the latest commit. It was a bug in my code.

Sometimes 2 windows are marked as active, not sure how I triggered it.

I am trying to track this down. This may be a LXQt bug - I am not sure. It's something to do with the activeWindowChanged(WId) signal.

If I switched desktop, all windows that were minimized by Show Desktop were suddenly restored.

This is by design (Wayfire design) and not a bug.

Then it's a very bad design, as it's usual with wayfire.

Not really - it's standard policy. You'll see this in case of Plasma as well. You "Show desktop", and then switch workspace, the "Show Desktop" is disabled and the windows are restored.

All windows minimized by Show Desktop were restored if I launched any GUI app.

Again by design, and not a bug.

Worse ;)

Again standard behaviour. You'll see this on plasma as well.

@marcusbritanicus
Copy link
Contributor Author

marcusbritanicus commented May 20, 2025

Move a view to next monitor by taskbar menu item: it appears on the monitor's taskbar only after a move of the view.

Yes, this is a wayfire bug. I have to discuss with @ammen99. For some reason, wayfire ends up emitting "unmap" on that view, and does not emit a "mapped" signal.

Apparently, the "unampped" is not sent on the view. The unmapped is completely unrelated to the view altogether.

Also, on closer look, LXQt Panel lacks a signal to indicate that output of a view has changed. I am planning on adding this signal (viewOutputChanged(QString)) to panel/backends/ilxqtabstractwmiface.h Do let me know if you prefer other name/place for this.

Edit: On second thoughts, I am simply going to emit windowPropertyChanged(...), which seems to do the trick. In some ways, changing an output is similar to changing the geometry of a window.

@marcusbritanicus
Copy link
Contributor Author

@tsujan @stefonarch I have added a few debug statements in the latest commit to help track down this button-based minimize/restore issue. Also, I have added other debug statements so we know what are the events we're receiving from wayfire. That way, we should be able to track down various issues.

A few tips on reading the output. Right after [Slot] ... output is printed, corresponding signal is emitted. For example, [Slot] View minimized ... results in windowStateChanged(...) to be emitted, and so on.

@stefonarch
Copy link
Member

stefonarch commented May 20, 2025

Sorry for the telegram style, wrote it immediately.

Fixed:

  • button is shown immediately in taskbar when moving window to next monitor
  • restore/maximize items correctly activated and working

Issues:

  • Maximize → minimize from menu: restore restores the previous state, not maximized. "restore" does not restore a previous maximized size, also if minimized by window decoration button edit: kwin does the same, I'm not used anymore to minimized windows...
  • Move to desktop 2, not working, move to all desktops, working, qterminal window, nothing is printed afaik

[Slot] Window property changed 47
[Slot] Window property changed 47
[Slot] Window property changed 47
[Slot] Window property changed 47
[Slot] View focused 47
==================================
[Taskbar Group] "qterminal" onActiveChanged 47 true
Button checked true LXQtTaskButton(0x634775b7a970)                                                                  
Group checked true
==================================
[Slot] Window property changed 47
[Slot] Window property changed 47
[Slot] Window property changed 47
[Slot] Window property changed 47
[Slot] Window property changed 47
[Slot] Window property changed 47
[Slot] View focused 47
==================================

[Taskbar Group] "qterminal" onActiveChanged 47 true
Button checked true LXQtTaskButton(0x634775b7a970)
Group checked true
==================================

  • Minimize/raise by taskbar buttons. Starting with active button, 4 clicks needed. After first click button is still active together with next window button, window minimized, second click fix activated state, third click raises, 4th click activates button
======================================
--> button is checked true
minimizeApplication() called
--> minimizing window 47
[Slot] View minimized 47
[Slot] Window property changed 47
[Slot] Window property changed 88
[Slot] View focused 88
==================================
[Taskbar Group] "qterminal" onActiveChanged 88 false
Group checked false
==================================
==================================
[Taskbar Group] "featherpad" onActiveChanged 88 true
Button checked true LXQtTaskButton(0x634776115db0)
Group checked true
==================================
==================================================
--> button is checked true
minimizeApplication() called
--> minimizing window 47
==================================================
--> button is checked false
raiseApplication() called
--> raising window 47
Unminimizing view first 47
[Slot] View minimized 47
[Slot] Window property changed 47
[Slot] Window property changed 88
[Slot] View focused 47
==================================
[Taskbar Group] "qterminal" onActiveChanged 47 true
Button checked true LXQtTaskButton(0x634775b7a970)
Group checked true
==================================
==================================
[Taskbar Group] "featherpad" onActiveChanged 47 false
Group checked false
==================================
Focusing view 47
==================================================
--> button is checked false
raiseApplication() called
--> raising window 47
Focusing view 47

  • always only "previous monitor" available (needs to look in kwin for that)

@marcusbritanicus
Copy link
Contributor Author

Minimize/raise by taskbar buttons. Starting with active button, 4 clicks needed. After first click button is still active together with next window button, window minimized, second click fix activated state, third click raises, 4th click activates button

Unfortunately... I do not know how I can fix this. Starting with the active button, once it's clicked, you know that the window is minimized, and the next view is focused. But the buttons do not seem to reflect this.

I initially thought this might have something to do with the logic in taskbar plugin. But you can see:

[Taskbar Group] "featherpad" onActiveChanged 88 true
Button checked true LXQtTaskButton(0x634776115db0)
Group checked true

The featherpad button is checked: Button checked true LXQtTaskButton(0x634776115db0) The true comes from button->isChecked()

Is there a mechanism elsewhere which changes the button->setChecked(...)? I ask because until the next two clicks, this button does not get "checked". The window on the other hand, is already active.

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