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

Refactor Window Manager interaction #2041

Merged
merged 44 commits into from
Jun 6, 2024
Merged

Conversation

gfgit
Copy link
Member

@gfgit gfgit commented Mar 26, 2024

This is a replacement for #2029 rebased on latest master

Main differences with initial idea:

  • Now ILXQtTaskbarAbstractBackend is stored globally inside LXQtPanelApplication (infact I should drop "taskbar" part of the name)
  • LXQtPanel uses this class for auto-hide logic (not sure if it's working yet)

TODO: port other plugins which currently directly use X11 to use this abstract interface

gfgit added 26 commits April 11, 2024 15:51
This is an abstract interface to operate windows
and workspaces
- Move WindowProperty enum to lxqttaskbartypes.h
This model will manage the tasks shown
Also use it to get window icon
- Don't rely on global screen coordinates

- This will be needed for future Wayland port,
  Where we don't have global screen coordinates

- Keep compatible behavior on X11
This new window propery flag is needed to notify geometry changes
panel/lxqtpanel.cpp Outdated Show resolved Hide resolved
panel/lxqtpanel.cpp Outdated Show resolved Hide resolved
panel/lxqtpanel.cpp Outdated Show resolved Hide resolved
panel/lxqtpanel.cpp Outdated Show resolved Hide resolved
panel/lxqtpanel.cpp Outdated Show resolved Hide resolved
@stefonarch
Copy link
Member

stefonarch commented May 13, 2024

There is basic issue with this PR and the ones based upon. If no lxqt-panel is installed and ilxqtpanel.h ilxqtpanelplugin.h lxqtpanelglobals.h pluginsettings.h aren't already available in /usr/include/lxqt build fails:

[  2%] Built target sysstat_autogen

AutoMoc subprocess error
------------------------
The moc process failed to compile
  "SRC:/plugin-taskbar/lxqttaskbarplugin.h"
into
  "SRC:/build/plugin-taskbar/taskbar_autogen/EWIEGA46WW/moc_lxqttaskbarplugin.cpp"
Process failed with return value 1

Command
-------
/usr/lib/qt6/moc "-DLXQT_DATA_DIR=\"/usr/share\"" "-DLXQT_ETC_XDG_DIR=\"/etc/xdg\"" "-DLXQT_GRAPHICS_DIR=\"/usr/share/lxqt/graphics\"" "-DLXQT_MAJOR_VERSION=\"2\"" "-DLXQT_MINOR_VERSION=\"0\"" "-DLXQT_PANEL_VERSION=\"2.0.0\"" "-DLXQT_PATCH_VERSION=\"0\"" "-DLXQT_RELATIVE_SHARE_DIR=\"lxqt\"" "-DLXQT_RELATIVE_SHARE_TRANSLATIONS_DIR=\"lxqt/translations\"" "-DLXQT_SHARE_DIR=\"/usr/share/lxqt\"" "-DLXQT_SHARE_TRANSLATIONS_DIR=\"/usr/share/lxqt/translations\"" "-DLXQT_VERSION=\"2.0.0\"" "-DPLUGIN_DIR=\"/usr/lib/lxqt-panel\"" -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_NO_FOREACH -DQT_NO_URL_CAST_FROM_STRING -DQT_STRICT_ITERATORS -DQT_SVG_LIB -DQT_USE_QSTRINGBUILDER -DQT_WIDGETS_LIB -DQT_XML_LIB -DWITH_DESKTOPSWITCH_PLUGIN -DWITH_FANCYMENU_PLUGIN -DWITH_MAINMENU_PLUGIN -DWITH_QUICKLAUNCH_PLUGIN -DWITH_SHOWDESKTOP_PLUGIN -DWITH_TASKBAR_PLUGIN -I/home/stef/git/lxqt/lxqt-panel/build/plugin-taskbar -I/home/stef/git/lxqt/lxqt-panel/plugin-taskbar -I/usr/include/qt6/QtWidgets -I/usr/include/qt6 -I/usr/include/qt6/QtCore -I/usr/lib/qt6/mkspecs/linux-g++ -I/usr/include/qt6/QtGui -I/usr/include/lxqt -I/usr/include/lxqt/LXQt -I/usr/include/KF6/KWindowSystem -I/usr/include/qt6/QtDBus -I/usr/include/qt6xdg -I/usr/include/qt6/QtXml -I/usr/include/qt6xdgiconloader -I/usr/include/qt6xdgiconloader/4.0.0 -I/usr/include/qt6/QtSvg -I/usr/include/lxqt-globalkeys -I/usr/include -I/usr/include/c++/13.2.1 -I/usr/include/c++/13.2.1/x86_64-pc-linux-gnu -I/usr/include/c++/13.2.1/backward -I/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include -I/usr/local/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include-fixed --include /home/stef/git/lxqt/lxqt-panel/build/plugin-taskbar/taskbar_autogen/moc_predefs.h --output-dep-file -o /home/stef/git/lxqt/lxqt-panel/build/plugin-taskbar/taskbar_autogen/EWIEGA46WW/moc_lxqttaskbarplugin.cpp /home/stef/git/lxqt/lxqt-panel/plugin-taskbar/lxqttaskbarplugin.h

Output
------
/home/stef/git/lxqt/lxqt-panel/plugin-taskbar/lxqttaskbarplugin.h:62:1: error: Undefined interface

People without an existing installation of lxqt-panel got /lxqt-panel/plugin-taskbar/lxqttaskbarplugin.h:62:1: error: Undefined interface at 72%.

@tsujan
Copy link
Member

tsujan commented May 13, 2024

Confirming @stefonarch's surprising observation.

@stefonarch
Copy link
Member

@gfgit Do you have some time to look at the remaining issues?

@gfgit
Copy link
Member Author

gfgit commented May 31, 2024

Hi, I'm back. Compile issues should be fixed by latest commit

@gfgit
Copy link
Member Author

gfgit commented May 31, 2024

@tsujan I've reverted commit regarding panel positioning. It only affects Wayland which is not yet merged.
To be honest lxqtpanel.cpp is a bit messy, with multiple "delayed" calls and workarounds for various issues which include also desktopswitch.cpp warning about realign().
Since this must change anyway for Wayland because we cannot rely on global coordinates there, it might be better to clean the logic a bit.

@stefonarch
Copy link
Member

Compile issues should be fixed by latest commit

Confirmed. I see that now there are 6 files instead of the previous 4:

stef@archlinux:lxqt-panel$ cd /usr/include/lxqt
stef@archlinux:lxqt$ ls
ilxqtpanel.h        LXQt                pluginsettings.h
ilxqtpanelplugin.h  lxqtpanelglobals.h
stef@archlinux:lxqt$ sudo mv *.h /tmp
stef@archlinux:lxqt$ ls
LXQt
stef@archlinux:lxqt$ ls
ilxqtpanel.h                   lxqtpanelglobals.h
ilxqtpanelplugin.h             lxqttaskbartypes.h
ilxqttaskbarabstractbackend.h  pluginsettings.h
LXQt

Will do some test later on X11.

@tsujan
Copy link
Member

tsujan commented May 31, 2024

Since this must change anyway for Wayland because we cannot rely on global coordinates there

Under Wayland, Qt's global coordinates are actually local and calculated relative to the window.

Please resolve the conflicts with the master branch.

@gfgit
Copy link
Member Author

gfgit commented Jun 5, 2024

@tsujan Conflicts are fixed now

@tsujan
Copy link
Member

tsujan commented Jun 5, 2024

Conflicts are fixed now

Thanks! I'll continue reviewing tomorrow.

@stefonarch
Copy link
Member

@gfgit I get compiling errors now:

[ 28%] Building CXX object plugin-fancymenu/CMakeFiles/fancymenu.dir/lxqtfancymenu.cpp.o                                              
/tmp/makepkg/lxqt-panel-git/src/lxqt-panel/plugin-desktopswitch/desktopswitch.cpp: In constructor 'DesktopSwitch::DesktopSwitch(const ILXQtPanelPluginStartupInfo&)':
/tmp/makepkg/lxqt-panel-git/src/lxqt-panel/plugin-desktopswitch/desktopswitch.cpp:55:5: error: class 'DesktopSwitch' does not have any field named 'mDesktops'
   55 |     mDesktops(nullptr),

@gfgit
Copy link
Member Author

gfgit commented Jun 6, 2024 via email

@stefonarch
Copy link
Member

Does it build fine if you remove the line?

Yes, thanks.

Copy link
Member

@tsujan tsujan left a comment

Choose a reason for hiding this comment

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

I can't say that my review is complete — it's done in separate stages, and the code has been changed after each of them — but, as far as my free time allowed, I found some problems that are fixed now. IMO, this PR has waited enough, considering that 2 other works depend on it.

So, GTM.

@tsujan tsujan merged commit 5def5ac into master Jun 6, 2024
@tsujan tsujan deleted the work/gfgit/refactor_wm_interaction branch June 6, 2024 16:08
@gfgit
Copy link
Member Author

gfgit commented Jun 6, 2024

Thanks!

@tsujan
Copy link
Member

tsujan commented Jun 6, 2024

Thanks!

Thank you for doing this great job!

Please also rebase your other PR if it needs that. I hope we could merge it and @marcusbritanicus's PR soon because we need more testers.

@marcusbritanicus
Copy link
Contributor

marcusbritanicus commented Jun 6, 2024

I am having a rather strange compilation issue: I have not seen anyone else complain about it, so it might be a problem in my setup. But it would be nice to figure out the issue.

FAILED: panel/lxqt-panel                                                                                                                                                                                                                                                   
: && /usr/bin/c++ -fno-exceptions -Wall -Wextra -Wchar-subscripts -Wno-long-long -Wpointer-arith -Wundef -Wformat-security -Wnon-virtual-dtor -Woverloaded-virtual -Wpedantic -fdiagnostics-color=always -O3 -DNDEBUG -Wl,-Bsymbolic-functions    -Wl,--export-dynamic -rdynamic panel/CMakeFiles/lxqt-panel.dir/lxqt-panel_autogen/mocs_compilation.cpp.o panel/CMakeFiles/lxqt-panel.dir/main.cpp.o panel/CMakeFiles/lxqt-panel.dir/panelpluginsmodel.cpp.o panel/CMakeFiles/lxqt-panel.dir/windownotifier.cpp.o panel/CMakeFiles/lxqt-panel.dir/lxqtpanel.cpp.o panel/CMakeFiles/lxqt-panel.dir/lxqtpanelapplication.cpp.o panel/CMakeFiles/lxqt-panel.dir/lxqtpanellayout.cpp.o panel/CMakeFiles/lxqt-panel.dir/plugin.cpp.o panel/CMakeFiles/lxqt-panel.dir/pluginsettings.cpp.o panel/CMakeFiles/lxqt-panel.dir/popupmenu.cpp.o panel/CMakeFiles/lxqt-panel.dir/pluginmoveprocessor.cpp.o panel/CMakeFiles/lxqt-panel.dir/lxqtpanelpluginconfigdialog.cpp.o panel/CMakeFiles/lxqt-panel.dir/config/configpaneldialog.cpp.o panel/CMakeFiles/lxqt-panel.dir/config/configplacement.cpp.o panel/CMakeFiles/lxqt-panel.dir/config/configstyling.cpp.o panel/CMakeFiles/lxqt-panel.dir/config/configpluginswidget.cpp.o panel/CMakeFiles/lxqt-panel.dir/config/addplugindialog.cpp.o panel/CMakeFiles/lxqt-panel.dir/backends/ilxqttaskbarabstractbackend.cpp.o panel/CMakeFiles/lxqt-panel.dir/backends/lxqttaskbardummybackend.cpp.o panel/CMakeFiles/lxqt-panel.dir/backends/xcb/lxqttaskbarbackend_x11.cpp.o panel/CMakeFiles/lxqt-panel.dir/LXQtAppTranslationLoader.cpp.o -o panel/lxqt-panel  /usr/lib/libLayerShellQtInterface.so.6.0.5  plugin-desktopswitch/libdesktopswitch.a  plugin-fancymenu/libfancymenu.a  plugin-mainmenu/libmainmenu.a  plugin-quicklaunch/libquicklaunch.a  plugin-showdesktop/libshowdesktop.a  plugin-taskbar/libtaskbar.a  plugin-statusnotifier/libstatusnotifier.a  plugin-tray/libtray.a  plugin-worldclock/libworldclock.a  plugin-spacer/libspacer.a  /usr/lib/liblxqt-globalkeys-ui.so.2.0.0  /usr/lib/liblxqt-globalkeys.so.2.0.0  /usr/lib/libdbusmenu-lxqt.so.0.1.0  /usr/lib/libQt6Concurrent.so.6.7.1  /usr/lib/libxcb.so  /usr/lib/libxcb-render.so  /usr/lib/libxcb-shape.so  /usr/lib/libxcb-xfixes.so  /usr/lib/libxcb-shm.so  /usr/lib/libxcb-composite.so  /usr/lib/libxcb-damage.so  /usr/lib/libxcb-image.so  /usr/lib/libxcb-randr.so  /usr/lib/libxcb-util.so  -L/usr/lib  -lXtst  /usr/lib/liblxqt.so.2.0.0  /usr/lib/libQt6Xdg.so.4.0.0  /usr/lib/libQt6Xml.so.6.7.1  /usr/lib/libQt6DBus.so.6.7.1  /usr/lib/libQt6XdgIconLoader.so.4.0.0  /usr/lib/libQt6Svg.so.6.7.1  /usr/lib/libglib-2.0.so  /usr/lib/libgobject-2.0.so  /usr/lib/libgio-2.0.so  /usr/lib/libQt6Widgets.so.6.7.1  /usr/lib/libKF6WindowSystem.so.5.249.0  /usr/lib/libQt6Gui.so.6.7.1  /usr/lib/libQt6Core.so.6.7.1  /usr/lib/libGLX.so  /usr/lib/libOpenGL.so  /usr/lib/libX11.so && :                                                                                                                               
/usr/bin/ld: panel/CMakeFiles/lxqt-panel.dir/backends/xcb/lxqttaskbarbackend_x11.cpp.o: in function `LXQtTaskbarX11Backend::moveApplication(unsigned long long)':                                                                                                          
lxqttaskbarbackend_x11.cpp:(.text+0x229b): undefined reference to `NETRootInfo::moveResizeRequest(unsigned int, int, int, NET::Direction, unsigned char, NET::RequestSource)'
/usr/bin/ld: panel/CMakeFiles/lxqt-panel.dir/backends/xcb/lxqttaskbarbackend_x11.cpp.o: in function `LXQtTaskbarX11Backend::resizeApplication(unsigned long long)':
lxqttaskbarbackend_x11.cpp:(.text+0x23dd): undefined reference to `NETRootInfo::moveResizeRequest(unsigned int, int, int, NET::Direction, unsigned char, NET::RequestSource)'
collect2: error: ld returned 1 exit status
ninja: build stopped: cannot make progress due to previous errors.

Edit:
Note: In my PR, these two lines are commented out so that I could test it.

@gfgit gfgit mentioned this pull request Jun 9, 2024
4 tasks
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.

4 participants