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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions panel/backends/ilxqtabstractwmiface.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class LXQT_PANEL_API ILXQtAbstractWMInterface : public QObject
// Workspaces
// NOTE: indexes are 1-based, 0 means "Show on All desktops"
virtual int getWorkspacesCount() const = 0;
virtual QString getWorkspaceName(int idx) const = 0;
virtual QString getWorkspaceName(int idx, QString outputName = QString()) const = 0;

virtual int getCurrentWorkspace() const = 0;
virtual bool setCurrentWorkspace(int idx) = 0;
Expand Down Expand Up @@ -121,7 +121,7 @@ class LXQT_PANEL_API ILXQtAbstractWMInterface : public QObject
// Workspaces
void workspacesCountChanged();
void workspaceNameChanged(int idx);
void currentWorkspaceChanged(int idx);
void currentWorkspaceChanged(int idx, QString outputName = QString());

// TODO: needed?
void activeWindowChanged(WId windowId);
Expand Down
3 changes: 1 addition & 2 deletions panel/backends/lxqtdummywmbackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ int LXQtDummyWMBackend::getWorkspacesCount() const
return 1; // Fake 1 workspace
}

QString LXQtDummyWMBackend::getWorkspaceName(int) const
QString LXQtDummyWMBackend::getWorkspaceName(int, QString) const
{
return QString();
}
Expand Down Expand Up @@ -199,4 +199,3 @@ bool LXQtDummyWMBackend::showDesktop(bool)
{
return false;
}

2 changes: 1 addition & 1 deletion panel/backends/lxqtdummywmbackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class LXQtDummyWMBackend : public ILXQtAbstractWMInterface

// Workspaces
int getWorkspacesCount() const override;
QString getWorkspaceName(int idx) const override;
QString getWorkspaceName(int idx, QString outputName = QString()) const override;

int getCurrentWorkspace() const override;
bool setCurrentWorkspace(int idx) override;
Expand Down
1 change: 1 addition & 0 deletions panel/backends/wayland/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
add_subdirectory(kwin_wayland)
add_subdirectory(wlroots)
add_subdirectory(wayfire)
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ int LXQtWMBackend_KWinWayland::getWorkspacesCount() const
return m_workspaceInfo->numberOfDesktops();
}

QString LXQtWMBackend_KWinWayland::getWorkspaceName(int idx) const
QString LXQtWMBackend_KWinWayland::getWorkspaceName(int idx, QString) const
{
return m_workspaceInfo->getDesktopName(idx - 1); //Return to 0-based
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class LXQtWMBackend_KWinWayland : public ILXQtAbstractWMInterface

// Workspaces
virtual int getWorkspacesCount() const override;
virtual QString getWorkspaceName(int idx) const override;
virtual QString getWorkspaceName(int idx, QString sceenName = QString()) const override;

virtual int getCurrentWorkspace() const override;
virtual bool setCurrentWorkspace(int idx) override;
Expand Down
35 changes: 35 additions & 0 deletions panel/backends/wayland/wayfire/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
set(PLATFORM_NAME wayfire)

set(PREFIX_NAME wmbackend)
set(PROGRAM "lxqt-panel")
set(BACKEND "backend")
set(NAME ${PREFIX_NAME}_${PLATFORM_NAME})
project(${PROGRAM}_${BACKEND}_${NAME})

find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS WaylandClient Concurrent)
find_package(Qt6Xdg)

set(PROG_SHARE_DIR ${CMAKE_INSTALL_FULL_DATAROOTDIR}/lxqt/${PROGRAM}/${BACKEND})
set(PLUGIN_SHARE_DIR ${PROG_SHARE_DIR}/${BACKEND}/${NAME})
#************************************************

if (NOT DEFINED PLUGIN_DIR)
set (PLUGIN_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/${PROGRAM})
endif (NOT DEFINED PLUGIN_DIR)

set(QTX_LIBRARIES Qt6::Gui Qt6::GuiPrivate)

set(
SRC
wayfire-common.cpp wayfire-common.h
lxqtwmbackend_wf.cpp lxqtwmbackend_wf.h
)

add_library(${NAME} MODULE ${SRC}) # build dynamically loadable modules
install(TARGETS ${NAME} DESTINATION ${PLUGIN_DIR}/${BACKEND}) # install the *.so file

target_link_libraries(${NAME} ${QTX_LIBRARIES} Qt6::Concurrent Qt6::WaylandClient Qt6Xdg)

# qt6_generate_wayland_protocol_client_sources(${NAME} FILES
# ${CMAKE_CURRENT_SOURCE_DIR}/wlr-foreign-toplevel-management-unstable-v1.xml
# )
Loading