Skip to content
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: 3 additions & 1 deletion src/server/src/actions/wm/window-actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
#include "services/window-manager/window-manager.hpp"
#include "ui/action-pannel/action.hpp"
#include "ui/image/url.hpp"
#include <QTimer>

class FocusWindowAction : public AbstractAction {
std::shared_ptr<AbstractWindowManager::AbstractWindow> m_window;

void execute(ApplicationContext *ctx) override {
auto wm = ctx->services->windowManager();
wm->provider()->focusWindowSync(*m_window.get());
auto window = m_window;
QTimer::singleShot(0, [wm, window]() { wm->provider()->focusWindowSync(*window.get()); });
}

public:
Expand Down
4 changes: 2 additions & 2 deletions src/server/src/qml/launcher-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ void LauncherWindow::setExclusiveFocus(bool exclusive) {
if (!isLayerShellActive()) return;

const auto &lc = m_ctx.services->config()->value().launcherWindow.layerShell;
int ki = (exclusive && lc.keyboardInteractivity == "exclusive") ? 1 : 2; // Exclusive : OnDemand
int ki = (exclusive && lc.keyboardInteractivity == "exclusive" && !Environment::isHyprlandCompositor()) ? 1 : 2; // Exclusive : OnDemand
if (m_lsKeyboardInteractivity != ki) {
m_lsKeyboardInteractivity = ki;
emit lsChanged();
Expand All @@ -627,7 +627,7 @@ void LauncherWindow::updateLayerShellProps() {

int layer = (lc.layer == "overlay") ? 3 : 2; // LayerOverlay : LayerTop
int ki = 2; // OnDemand
if (lc.keyboardInteractivity == "exclusive" && !cfg.closeOnFocusLoss) ki = 1; // Exclusive
if (lc.keyboardInteractivity == "exclusive" && !cfg.closeOnFocusLoss && !Environment::isHyprlandCompositor()) ki = 1; // Exclusive

bool changed = false;
if (m_lsLayer != layer) {
Expand Down
7 changes: 3 additions & 4 deletions src/server/src/services/window-manager/hyprland/hyprland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,15 @@ AbstractWindowManager::WindowPtr HyprlandWindowManager::getFocusedWindowSync() c

void HyprlandWindowManager::focusWindowSync(const AbstractWindow &window) const {
auto addr = window.id().toStdString();
qDebug() << "Hyprland focusWindowSync:" << window.id();
Hyprctl::oneshot(std::format("[[BATCH]]dispatch focuswindow address:{0}"
";eval hl.dispatch(hl.dsp.focus({{window=\"address:{0}\"}}))",
";dispatch layoutmsg center",
addr));
}

bool HyprlandWindowManager::closeWindow(const AbstractWindow &window) const {
auto addr = window.id().toStdString();
Hyprctl::oneshot(std::format("[[BATCH]]dispatch closewindow address:{0}"
";eval hl.dispatch(hl.dsp.window.close({{window=\"address:{0}\"}}))",
addr));
Hyprctl::oneshot(std::format("[[BATCH]]dispatch closewindow address:{0}", addr));
emit windowsChanged();

return true;
Expand Down