Skip to content

Commit

Permalink
Fix issue with restore (from task context menu. Remove debug messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusbritanicus committed Mar 31, 2024
1 parent fa1defa commit 5b25762
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 19 deletions.
8 changes: 0 additions & 8 deletions panel/backends/wayland/lxqttaskbarbackendwayland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,39 @@ LXQtTaskbarWaylandBackend::LXQtTaskbarWaylandBackend(QObject *parent)
* If wayfire/sway/labwc/hyprland/wlroots is in desktopsList, we'll use the wlroots backend.
*/
QList<QByteArray> desktopsList = qgetenv("XDG_CURRENT_DESKTOP").toLower().split(':');
qDebug() << "--------------> Current desktop" << desktopsList;
for( QByteArray desktop: desktopsList ) {
if ( desktop == "plasma" || desktop == "kde" || desktop == "kwin_wayland" )
{
qDebug() << "--------------> Using plasma backend";
m_backend = new LXQtTaskbarPlasmaBackend();
break;
}

else if ( desktop == "wayfire" )
{
qDebug() << "--------------> Using wayfire backend";
m_backend = new LXQtTaskbarWlrootsBackend();
break;
}

else if ( desktop == "sway" )
{
qDebug() << "--------------> Using sway backend";
m_backend = new LXQtTaskbarWlrootsBackend();
break;
}

else if ( desktop == "labwc" )
{
qDebug() << "--------------> Using labwc backend";
m_backend = new LXQtTaskbarWlrootsBackend();
break;
}

else if ( desktop == "hyprland" )
{
qDebug() << "--------------> Using hyprland backend";
m_backend = new LXQtTaskbarWlrootsBackend();
break;
}

else if ( desktop == "wlroots" )
{
qDebug() << "--------------> Using generic wlroots backend";
m_backend = new LXQtTaskbarWlrootsBackend();
break;
}
Expand All @@ -69,7 +62,6 @@ LXQtTaskbarWaylandBackend::LXQtTaskbarWaylandBackend(QObject *parent)
}

if ( m_backend == nullptr ) {
qDebug() << "--------------> Using dummy backend. No window management will be done";
}

else {
Expand Down
13 changes: 6 additions & 7 deletions panel/backends/wayland/wlroots/lxqttaskbarbackendwlr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,13 @@ bool LXQtTaskbarWlrootsBackend::setWindowState(WId windowId, LXQtTaskBarWindowSt
}
case LXQtTaskBarWindowState::Normal:
{
/** Restore if maximized/minimized */
if ( window->windowState.minimized) {
window->unset_minimized();
if (set)
{
if ( window->windowState.maximized) {
window->unset_maximized();
}
}

if ( window->windowState.maximized) {
window->unset_maximized();
}
break;
}

Expand Down Expand Up @@ -229,7 +228,7 @@ bool LXQtTaskbarWlrootsBackend::isWindowActive(WId windowId) const

bool LXQtTaskbarWlrootsBackend::raiseWindow(WId windowId, bool onCurrentWorkSpace)
{
Q_UNUSED(onCurrentWorkSpace) //TODO
Q_UNUSED(onCurrentWorkSpace) // Cannot be done on a generic wlroots-based compositor!

LXQtTaskbarWlrootsWindow *window = getWindow(windowId);
if(!window)
Expand Down
2 changes: 0 additions & 2 deletions panel/lxqtpanelapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@
ILXQtTaskbarAbstractBackend *createWMBackend()
{
if(qGuiApp->nativeInterface<QNativeInterface::QX11Application>()){
qDebug() << "--------------> X11Application";
return new LXQtTaskbarX11Backend;
}

else if(qGuiApp->nativeInterface<QNativeInterface::QWaylandApplication>()){
qDebug() << "--------------> WaylandApplication";
return new LXQtTaskbarWaylandBackend;
}

Expand Down
1 change: 0 additions & 1 deletion plugin-taskbar/lxqttaskbarplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ LXQtTaskBarPlugin::LXQtTaskBarPlugin(const ILXQtPanelPluginStartupInfo &startupI
ILXQtPanelPlugin(startupInfo)

{
qDebug() << "--------------> Init plugin taskbar";
mTaskBar = new LXQtTaskBar(this);
}

Expand Down
3 changes: 2 additions & 1 deletion plugin-taskbar/lxqttaskbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ void LXQtTaskButton::deMaximizeApplication()
{
mBackend->setWindowState(mWindow, LXQtTaskBarWindowState::Maximized, false);

if(!mBackend->isWindowActive(mWindow))
/** This guard is unnecessary */
// if(!mBackend->isWindowActive(mWindow))
mBackend->raiseWindow(mWindow, parentTaskBar()->raiseOnCurrentDesktop());
}

Expand Down

0 comments on commit 5b25762

Please sign in to comment.