summaryrefslogtreecommitdiff
path: root/src/events
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-20 13:37:07 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-20 13:37:07 +0100
commit332fa8a802dd89f16848765cab8a1483e09e73aa (patch)
tree27a4a8dc9ce7d32b56b7b16b613e40d9197a0671 /src/events
parent5d0919fcff3ee3e321b1a0b2f1e4a7c6db97f9a8 (diff)
XWayland floating
Diffstat (limited to 'src/events')
-rw-r--r--src/events/Events.cpp19
-rw-r--r--src/events/Events.hpp5
2 files changed, 21 insertions, 3 deletions
diff --git a/src/events/Events.cpp b/src/events/Events.cpp
index dd34bba8..583d52aa 100644
--- a/src/events/Events.cpp
+++ b/src/events/Events.cpp
@@ -396,7 +396,10 @@ void Events::listener_mapWindow(wl_listener* listener, void* data) {
PWINDOW->m_iMonitorID = PMONITOR->ID;
PWINDOW->m_bMappedX11 = true;
- g_pLayoutManager->getCurrentLayout()->onWindowCreated(PWINDOW);
+ if (g_pXWaylandManager->shouldBeFloated(PWINDOW))
+ g_pLayoutManager->getCurrentLayout()->onWindowCreatedFloating(PWINDOW);
+ else
+ g_pLayoutManager->getCurrentLayout()->onWindowCreated(PWINDOW);
g_pCompositor->focusWindow(PWINDOW);
@@ -579,11 +582,21 @@ void Events::listener_readyXWayland(wl_listener* listener, void* data) {
const auto XCBCONNECTION = xcb_connect(g_pXWaylandManager->m_sWLRXWayland->display_name, NULL);
const auto ERR = xcb_connection_has_error(XCBCONNECTION);
if (ERR) {
- Debug::log(LogLevel::ERR, "xcb_connection_has_error failed with %i", ERR);
+ Debug::log(LogLevel::ERR, "XWayland -> xcb_connection_has_error failed with %i", ERR);
return;
}
- // TODO: atoms
+ for (auto& ATOM : HYPRATOMS) {
+ xcb_intern_atom_cookie_t cookie = xcb_intern_atom(XCBCONNECTION, 0, ATOM.first.length(), ATOM.first.c_str());
+ xcb_intern_atom_reply_t* reply = xcb_intern_atom_reply(XCBCONNECTION, cookie, NULL);
+
+ if (!reply) {
+ Debug::log(LogLevel::ERR, "XWayland -> Atom failed: %s", ATOM.first.c_str());
+ continue;
+ }
+
+ ATOM.second = reply->atom;
+ }
wlr_xwayland_set_seat(g_pXWaylandManager->m_sWLRXWayland, g_pCompositor->m_sWLRSeat);
diff --git a/src/events/Events.hpp b/src/events/Events.hpp
index 90c23eaa..9a1a9cb1 100644
--- a/src/events/Events.hpp
+++ b/src/events/Events.hpp
@@ -21,6 +21,11 @@ namespace Events {
LISTENER(destroyPopup);
LISTENER(commitPopup);
+ LISTENER(newPopupXDG);
+ LISTENER(mapPopupXDG);
+ LISTENER(unmapPopupXDG);
+ LISTENER(destroyPopupXDG);
+ LISTENER(commitPopupXDG);
// Surface XDG (window)
LISTENER(newXDGSurface);