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

Is possible to build Hyprland in pure wayland? #891

Closed
Mederim opened this issue Oct 22, 2022 · 2 comments
Closed

Is possible to build Hyprland in pure wayland? #891

Mederim opened this issue Oct 22, 2022 · 2 comments

Comments

@Mederim
Copy link

Mederim commented Oct 22, 2022

I tried to build hyprland in a pure wayland system for the distro called KISS Linux, and this distro purged xorg just have the libxkbcommon xorg dependencie for build sway. Everytime i try to build hyprland with -DNO_WAYLAND=true it can't build cause i don't have xcb installed and i don't know why need this in a pure wayland compositor.

@git-bruh
Copy link

Hacky patch: https://0x0.st/oxer.patch

diff --git a/meson.build b/meson.build
index c9900ec..498fa76 100644
--- a/meson.build
+++ b/meson.build
@@ -20,8 +20,8 @@ endif
 
 GIT_BRANCH = run_command('git', 'rev-parse', '--abbrev-ref', 'HEAD', check: false).stdout().strip()
 GIT_COMMIT_HASH = run_command('git', 'rev-parse', 'HEAD', check: false).stdout().strip()
-GIT_COMMIT_MESSAGE = run_command('bash', '-c', 'git show | head -n 5 | tail -n 1', check: false).stdout().strip()
-GIT_DIRTY = run_command('bash', '-c', 'git diff-index --quiet HEAD -- || echo "dirty"', check: false).stdout().strip()
+GIT_COMMIT_MESSAGE = run_command('sh', '-c', 'git show | head -n 5 | tail -n 1', check: false).stdout().strip()
+GIT_DIRTY = run_command('sh', '-c', 'git diff-index --quiet HEAD -- || echo "dirty"', check: false).stdout().strip()
 
 add_project_arguments(
   [
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 9e9dc25..5df1c27 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -264,10 +264,12 @@ void CCompositor::cleanup() {
 
     m_vMonitors.clear();
 
+#if 0
     if (g_pXWaylandManager->m_sWLRXWayland) {
         wlr_xwayland_destroy(g_pXWaylandManager->m_sWLRXWayland);
         g_pXWaylandManager->m_sWLRXWayland = nullptr;
     }
+#endif
 
     wl_display_terminate(m_sWLDisplay);
 
@@ -1677,6 +1679,7 @@ void CCompositor::moveUnmanagedX11ToWindows(CWindow* pWindow) {
 }
 
 CWindow* CCompositor::getX11Parent(CWindow* pWindow) {
+#if 0
     if (!pWindow->m_bIsX11)
         return nullptr;
 
@@ -1687,7 +1690,7 @@ CWindow* CCompositor::getX11Parent(CWindow* pWindow) {
         if (w->m_uSurface.xwayland == pWindow->m_uSurface.xwayland->parent)
             return w.get();
     }
-
+#endif
     return nullptr;
 }
 
diff --git a/src/Compositor.hpp b/src/Compositor.hpp
index aa4cd87..4f8126a 100644
--- a/src/Compositor.hpp
+++ b/src/Compositor.hpp
@@ -177,18 +177,3 @@ private:
 
 
 inline std::unique_ptr<CCompositor> g_pCompositor;
-
-// For XWayland
-inline std::map<std::string, xcb_atom_t> HYPRATOMS = {
-    HYPRATOM("_NET_WM_WINDOW_TYPE"),
-    HYPRATOM("_NET_WM_WINDOW_TYPE_NORMAL"),
-    HYPRATOM("_NET_WM_WINDOW_TYPE_DOCK"),
-    HYPRATOM("_NET_WM_WINDOW_TYPE_DIALOG"),
-    HYPRATOM("_NET_WM_WINDOW_TYPE_UTILITY"),
-    HYPRATOM("_NET_WM_WINDOW_TYPE_TOOLBAR"),
-    HYPRATOM("_NET_WM_WINDOW_TYPE_SPLASH"),
-    HYPRATOM("_NET_WM_WINDOW_TYPE_MENU"),
-    HYPRATOM("_NET_WM_WINDOW_TYPE_DROPDOWN_MENU"),
-    HYPRATOM("_NET_WM_WINDOW_TYPE_POPUP_MENU"),
-    HYPRATOM("_NET_WM_WINDOW_TYPE_TOOLTIP"),
-    HYPRATOM("_NET_WM_WINDOW_TYPE_NOTIFICATION")};
diff --git a/src/Window.cpp b/src/Window.cpp
index 03ca39a..10417dd 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -98,8 +98,6 @@ pid_t CWindow::getPID() {
     pid_t PID = -1;
     if (!m_bIsX11) {
         wl_client_get_credentials(wl_resource_get_client(m_uSurface.xdg->resource), &PID, nullptr, nullptr);
-    } else {
-        PID = m_uSurface.xwayland->pid;
     }
 
     return PID;
@@ -218,6 +216,7 @@ void CWindow::moveToWorkspace(int workspaceID) {
 }
 
 CWindow* CWindow::X11TransientFor() {
+#if 0
     if (!m_bIsX11)
         return nullptr;
 
@@ -234,6 +233,8 @@ CWindow* CWindow::X11TransientFor() {
         return nullptr;
 
     return PPARENT;
+#endif
+    return nullptr;
 }
 
 void CWindow::removeDecorationByType(eDecorationType type) {
@@ -260,4 +261,4 @@ void CWindow::setHidden(bool hidden) {
 
 bool CWindow::isHidden() {
     return m_bHidden;
-}
\ No newline at end of file
+}
diff --git a/src/Window.hpp b/src/Window.hpp
index 236ee47..80f2955 100644
--- a/src/Window.hpp
+++ b/src/Window.hpp
@@ -55,7 +55,6 @@ public:
 
     union {
         wlr_xdg_surface* xdg;
-        wlr_xwayland_surface* xwayland;
     } m_uSurface;
 
     // this is the position and size of the "bounding box"
@@ -156,7 +155,7 @@ public:
 
     // For the list lookup
     bool operator==(const CWindow& rhs) {
-        return m_uSurface.xdg == rhs.m_uSurface.xdg && m_uSurface.xwayland == rhs.m_uSurface.xwayland && m_vPosition == rhs.m_vPosition && m_vSize == rhs.m_vSize && m_bFadingOut == rhs.m_bFadingOut;
+        return m_uSurface.xdg == rhs.m_uSurface.xdg && m_vPosition == rhs.m_vPosition && m_vSize == rhs.m_vSize && m_bFadingOut == rhs.m_bFadingOut;
     }
 
     // methods
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index fd19931..df97131 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -387,10 +387,7 @@ void CConfigManager::handleRawExec(const std::string& command, const std::string
 
     std::string toExec = args;
 
-    if (g_pXWaylandManager->m_sWLRXWayland)
-        toExec = std::string("WAYLAND_DISPLAY=") + std::string(g_pCompositor->m_szWLDisplaySocket) + " DISPLAY=" + std::string(g_pXWaylandManager->m_sWLRXWayland->display_name) + " " + toExec;
-    else
-        toExec = std::string("WAYLAND_DISPLAY=") + std::string(g_pCompositor->m_szWLDisplaySocket) + " " + toExec;
+    toExec = std::string("WAYLAND_DISPLAY=") + std::string(g_pCompositor->m_szWLDisplaySocket) + " " + toExec;
 
     Debug::log(LOG, "Config executing %s", toExec.c_str());
 
diff --git a/src/events/Devices.cpp b/src/events/Devices.cpp
index eecba44..1f4d1a5 100644
--- a/src/events/Devices.cpp
+++ b/src/events/Devices.cpp
@@ -122,12 +122,15 @@ void Events::listener_destroyConstraint(void* owner, void* data) {
         const auto PWINDOW = g_pCompositor->getConstraintWindow(g_pCompositor->m_sSeat.mouse);
 
         if (PWINDOW) {
+#if 0
             if (PWINDOW->m_bIsX11) {
                 wlr_cursor_warp(g_pCompositor->m_sWLRCursor, nullptr,
                                 PCONSTRAINT->constraint->current.cursor_hint.x + PWINDOW->m_uSurface.xwayland->x, PWINDOW->m_uSurface.xwayland->y + PCONSTRAINT->constraint->current.cursor_hint.y);
 
                 wlr_seat_pointer_warp(PCONSTRAINT->constraint->seat, PCONSTRAINT->constraint->current.cursor_hint.x, PCONSTRAINT->constraint->current.cursor_hint.y);
             } else {
+#endif
+                {
                 wlr_cursor_warp(g_pCompositor->m_sWLRCursor, nullptr,
                                 PCONSTRAINT->constraint->current.cursor_hint.x + PWINDOW->m_vRealPosition.vec().x, PCONSTRAINT->constraint->current.cursor_hint.y + PWINDOW->m_vRealPosition.vec().y);
 
@@ -222,4 +225,4 @@ void Events::listener_holdBegin(wl_listener* listener, void* data) {
 
 void Events::listener_holdEnd(wl_listener* listener, void* data) {
     g_pInputManager->onPointerHoldEnd((wlr_pointer_hold_end_event*)data);
-}
\ No newline at end of file
+}
diff --git a/src/events/Misc.cpp b/src/events/Misc.cpp
index 8e02579..107934f 100644
--- a/src/events/Misc.cpp
+++ b/src/events/Misc.cpp
@@ -45,6 +45,7 @@ void Events::listener_requestSetSel(wl_listener* listener, void* data) {
 }
 
 void Events::listener_readyXWayland(wl_listener* listener, void* data) {
+#if 0
     const auto XCBCONNECTION = xcb_connect(g_pXWaylandManager->m_sWLRXWayland->display_name, NULL);
     const auto ERR = xcb_connection_has_error(XCBCONNECTION);
     if (ERR) {
@@ -72,6 +73,7 @@ void Events::listener_readyXWayland(wl_listener* listener, void* data) {
     }
 
     xcb_disconnect(XCBCONNECTION);
+#endif
 }
 
 void Events::listener_requestDrag(wl_listener* listener, void* data) {
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 8519716..2d92a20 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -354,6 +354,7 @@ void Events::listener_mapWindow(void* owner, void* data) {
         PWINDOW->hyprListener_requestResize.initCallback(&PWINDOW->m_uSurface.xdg->toplevel->events.request_resize, &Events::listener_requestResize, PWINDOW, "XDG Window Late");
         PWINDOW->hyprListener_fullscreenWindow.initCallback(&PWINDOW->m_uSurface.xdg->toplevel->events.request_fullscreen, &Events::listener_fullscreenWindow, PWINDOW, "XDG Window Late");
     } else {
+#if 0
         PWINDOW->hyprListener_fullscreenWindow.initCallback(&PWINDOW->m_uSurface.xwayland->events.request_fullscreen, &Events::listener_fullscreenWindow, PWINDOW, "XWayland Window Late");
         PWINDOW->hyprListener_activateX11.initCallback(&PWINDOW->m_uSurface.xwayland->events.request_activate, &Events::listener_activateX11, PWINDOW, "XWayland Window Late");
         PWINDOW->hyprListener_configureX11.initCallback(&PWINDOW->m_uSurface.xwayland->events.request_configure, &Events::listener_configureX11, PWINDOW, "XWayland Window Late");
@@ -361,6 +362,7 @@ void Events::listener_mapWindow(void* owner, void* data) {
 
         if (PWINDOW->m_iX11Type == 2)
             PWINDOW->hyprListener_setGeometryX11U.initCallback(&PWINDOW->m_uSurface.xwayland->events.set_geometry, &Events::listener_unmanagedSetGeometry, PWINDOW, "XWayland Window Late");
+#endif
     }
 
     // do the animation thing
@@ -620,8 +622,10 @@ void Events::listener_destroyWindow(void* owner, void* data) {
 
     Debug::log(LOG, "Window %x destroyed, queueing. (class %s)", PWINDOW, g_pXWaylandManager->getAppIDClass(PWINDOW).c_str());
 
+#if 0
     if (PWINDOW->m_bIsX11)
         Debug::log(LOG, "XWayland class raw: %s", PWINDOW->m_uSurface.xwayland->_class);
+#endif
 
     if (PWINDOW == g_pCompositor->m_pLastWindow) {
         g_pCompositor->m_pLastWindow = nullptr;
@@ -693,14 +697,17 @@ void Events::listener_activate(void* owner, void* data) {
 }
 
 void Events::listener_activateX11(void* owner, void* data) {
+#if 0
     CWindow* PWINDOW = (CWindow*)owner;
 
     if (PWINDOW->m_iX11Type == 1 /* Managed */) {
         wlr_xwayland_surface_activate(PWINDOW->m_uSurface.xwayland, 1);
     }
+#endif
 }
 
 void Events::listener_configureX11(void* owner, void* data) {
+#if 0
     CWindow* PWINDOW = (CWindow*)owner;
 
     if (!g_pCompositor->windowValidMapped(PWINDOW))
@@ -745,9 +752,11 @@ void Events::listener_configureX11(void* owner, void* data) {
     g_pHyprRenderer->damageWindow(PWINDOW);
 
     PWINDOW->updateWindowDecos();
+#endif
 }
 
 void Events::listener_unmanagedSetGeometry(void* owner, void* data) {
+#if 0
     CWindow* PWINDOW = (CWindow*)owner;
 
     if (!PWINDOW->m_bMappedX11)
@@ -776,9 +785,11 @@ void Events::listener_unmanagedSetGeometry(void* owner, void* data) {
         PWINDOW->updateWindowDecos();
         g_pHyprRenderer->damageWindow(PWINDOW);
     }
+#endif
 }
 
 void Events::listener_surfaceXWayland(wl_listener* listener, void* data) {
+#if 0
     const auto XWSURFACE = (wlr_xwayland_surface*)data;
 
     Debug::log(LOG, "New XWayland Surface created (class %s).", XWSURFACE->_class);
@@ -796,6 +807,7 @@ void Events::listener_surfaceXWayland(wl_listener* listener, void* data) {
     PNEWWINDOW->hyprListener_mapWindow.initCallback(&XWSURFACE->events.map, &Events::listener_mapWindow, PNEWWINDOW, "XWayland Window");
     PNEWWINDOW->hyprListener_unmapWindow.initCallback(&XWSURFACE->events.unmap, &Events::listener_unmapWindow, PNEWWINDOW, "XWayland Window");
     PNEWWINDOW->hyprListener_destroyWindow.initCallback(&XWSURFACE->events.destroy, &Events::listener_destroyWindow, PNEWWINDOW, "XWayland Window");
+#endif
 }
 
 void Events::listener_newXDGSurface(wl_listener* listener, void* data) {
diff --git a/src/includes.hpp b/src/includes.hpp
index 55e8282..851f261 100644
--- a/src/includes.hpp
+++ b/src/includes.hpp
@@ -6,7 +6,6 @@
 #pragma diag_suppress 1696
 #endif
 
-#include <X11/Xlib.h>
 #include <getopt.h>
 #include <libinput.h>
 #include <linux/input-event-codes.h>
@@ -80,13 +79,11 @@ extern "C" {
 #include <wlr/types/wlr_foreign_toplevel_management_v1.h>
 #include <wlr/types/wlr_idle_inhibit_v1.h>
 #include <wlr/util/log.h>
-#include <wlr/xwayland.h>
 #include <wlr/util/region.h>
 #include <wlr/types/wlr_tablet_pad.h>
 #include <wlr/types/wlr_tablet_tool.h>
 #include <wlr/types/wlr_tablet_v2.h>
 #include <xkbcommon/xkbcommon.h>
-#include <X11/Xproto.h>
 #include <wlr/render/egl.h>
 #include <wlr/render/gles2.h>
 #include <wlr/render/wlr_texture.h>
@@ -131,4 +128,4 @@ extern "C" {
 #include "ext-workspace-unstable-v1-protocol.h"
 
 #include <algorithm>
-#include <utility>
\ No newline at end of file
+#include <utility>
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index dabbe35..0087cc6 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -482,10 +482,7 @@ bool CKeybindManager::handleInternalKeybinds(xkb_keysym_t keysym) {
 // Dispatchers
 
 void CKeybindManager::spawn(std::string args) {
-    if (g_pXWaylandManager->m_sWLRXWayland)
-        args = "WAYLAND_DISPLAY=" + std::string(g_pCompositor->m_szWLDisplaySocket) + " DISPLAY=" + std::string(g_pXWaylandManager->m_sWLRXWayland->display_name) + " " + args;
-    else
-        args = "WAYLAND_DISPLAY=" + std::string(g_pCompositor->m_szWLDisplaySocket) + " " + args;
+    args = "WAYLAND_DISPLAY=" + std::string(g_pCompositor->m_szWLDisplaySocket) + " " + args;
 
     Debug::log(LOG, "Executing %s", args.c_str());
 
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp
index e998007..e57056f 100644
--- a/src/managers/XWaylandManager.cpp
+++ b/src/managers/XWaylandManager.cpp
@@ -3,6 +3,7 @@
 #include "../events/Events.hpp"
 
 CHyprXWaylandManager::CHyprXWaylandManager() {
+#if 0
     if (XWAYLAND) {
         m_sWLRXWayland = wlr_xwayland_create(g_pCompositor->m_sWLDisplay, g_pCompositor->m_sWLRCompositor, 1);
 
@@ -17,7 +18,10 @@ CHyprXWaylandManager::CHyprXWaylandManager() {
         setenv("DISPLAY", m_sWLRXWayland->display_name, 1);
 
         Debug::log(LOG, "CHyprXWaylandManager started on display %s", m_sWLRXWayland->display_name);
-    } else {
+    }
+#endif
+
+    {
         unsetenv("DISPLAY"); // unset DISPLAY so that X11 apps do not try to start on a different/invalid DISPLAY
     }
 }
@@ -27,8 +31,10 @@ CHyprXWaylandManager::~CHyprXWaylandManager() {
 }
 
 wlr_surface* CHyprXWaylandManager::getWindowSurface(CWindow* pWindow) {
+#if 0
     if (pWindow->m_bIsX11)
         return pWindow->m_uSurface.xwayland->surface;
+#endif
 
     return pWindow->m_uSurface.xdg->surface;
 }
@@ -42,16 +48,19 @@ void CHyprXWaylandManager::activateSurface(wlr_surface* pSurface, bool activate)
         if (PSURF && PSURF->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
             wlr_xdg_toplevel_set_activated(PSURF->toplevel, activate);
         }
-    } else if (wlr_surface_is_xwayland_surface(pSurface)) {
+    }
+#if 0
+      else if (wlr_surface_is_xwayland_surface(pSurface)) {
         wlr_xwayland_surface_activate(wlr_xwayland_surface_from_wlr_surface(pSurface), activate);
 
         if (activate)
             wlr_xwayland_surface_restack(wlr_xwayland_surface_from_wlr_surface(pSurface), NULL, XCB_STACK_MODE_ABOVE);
     }
-
+#endif
 }
 
 void CHyprXWaylandManager::activateWindow(CWindow* pWindow, bool activate) {
+#if 0
     if (pWindow->m_bIsX11) {
         if (pWindow->m_uSurface.xwayland->minimized)
             wlr_xwayland_surface_set_minimized(pWindow->m_uSurface.xwayland, false);
@@ -60,6 +69,7 @@ void CHyprXWaylandManager::activateWindow(CWindow* pWindow, bool activate) {
         wlr_xwayland_surface_restack(pWindow->m_uSurface.xwayland, NULL, XCB_STACK_MODE_ABOVE);
     }
     else
+#endif
         wlr_xdg_toplevel_set_activated(pWindow->m_uSurface.xdg->toplevel, activate);
 
     g_pCompositor->m_pLastFocus = getWindowSurface(pWindow);
@@ -70,6 +80,7 @@ void CHyprXWaylandManager::activateWindow(CWindow* pWindow, bool activate) {
 }
 
 void CHyprXWaylandManager::getGeometryForWindow(CWindow* pWindow, wlr_box* pbox) {
+#if 0
     if (pWindow->m_bIsX11) {
         const auto SIZEHINTS = pWindow->m_uSurface.xwayland->size_hints;
 
@@ -84,18 +95,23 @@ void CHyprXWaylandManager::getGeometryForWindow(CWindow* pWindow, wlr_box* pbox)
             pbox->width = pWindow->m_uSurface.xwayland->width;
             pbox->height = pWindow->m_uSurface.xwayland->height;
         }
-    } else {
+    } else
+#endif
+    {
         wlr_xdg_surface_get_geometry(pWindow->m_uSurface.xdg, pbox);
     }
 }
 
 std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
     try {
+#if 0
         if (pWindow->m_bIsX11) {
             if (pWindow->m_uSurface.xwayland && pWindow->m_uSurface.xwayland->title) {
                 return std::string(pWindow->m_uSurface.xwayland->title);
             }
-        } else if (pWindow->m_uSurface.xdg) {
+        } else
+#endif
+        if (pWindow->m_uSurface.xdg) {
             if (pWindow->m_uSurface.xdg->toplevel && pWindow->m_uSurface.xdg->toplevel->title) {
                 return std::string(pWindow->m_uSurface.xdg->toplevel->title);
             }
@@ -111,6 +127,7 @@ std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
 
 std::string CHyprXWaylandManager::getAppIDClass(CWindow* pWindow) {
     try {
+#if 0
         if (pWindow->m_bIsX11) {
             if (pWindow->m_uSurface.xwayland) {
                 if (!pWindow->m_bMappedX11 || !pWindow->m_bIsMapped)
@@ -118,7 +135,9 @@ std::string CHyprXWaylandManager::getAppIDClass(CWindow* pWindow) {
 
                 return std::string(pWindow->m_uSurface.xwayland->_class);
             }
-        } else if (pWindow->m_uSurface.xdg) {
+        } else
+#endif
+            if (pWindow->m_uSurface.xdg) {
             if (pWindow->m_uSurface.xdg->toplevel) {
                 return std::string(pWindow->m_uSurface.xdg->toplevel->app_id);
             }
@@ -133,9 +152,12 @@ std::string CHyprXWaylandManager::getAppIDClass(CWindow* pWindow) {
 }
 
 void CHyprXWaylandManager::sendCloseWindow(CWindow* pWindow) {
+#if 0
     if (pWindow->m_bIsX11) {
         wlr_xwayland_surface_close(pWindow->m_uSurface.xwayland);
-    } else {
+    } else
+#endif
+    {
         wlr_xdg_toplevel_send_close(pWindow->m_uSurface.xdg->toplevel);
     }
 }
@@ -148,9 +170,11 @@ void CHyprXWaylandManager::setWindowSize(CWindow* pWindow, const Vector2D& size,
     pWindow->m_vReportedPosition = pWindow->m_vRealPosition.vec();
     pWindow->m_vReportedSize = size;
 
+#if 0
     if (pWindow->m_bIsX11)
         wlr_xwayland_surface_configure(pWindow->m_uSurface.xwayland, pWindow->m_vRealPosition.vec().x, pWindow->m_vRealPosition.vec().y, size.x, size.y);
     else
+#endif
         wlr_xdg_toplevel_set_size(pWindow->m_uSurface.xdg->toplevel, size.x, size.y);
 }
 
@@ -160,13 +184,15 @@ void CHyprXWaylandManager::setWindowStyleTiled(CWindow* pWindow, uint32_t edgez)
 }
 
 wlr_surface* CHyprXWaylandManager::surfaceAt(CWindow* pWindow, const Vector2D& client, Vector2D& surface) {
+#if 0
     if (pWindow->m_bIsX11)
         return wlr_surface_surface_at(pWindow->m_uSurface.xwayland->surface, client.x, client.y, &surface.x, &surface.y);
-
+#endif
     return wlr_xdg_surface_surface_at(pWindow->m_uSurface.xdg, client.x, client.y, &surface.x, &surface.y);
 }
 
 bool CHyprXWaylandManager::shouldBeFloated(CWindow* pWindow) {
+#if 0
     if (pWindow->m_bIsX11) {
         for (size_t i = 0; i < pWindow->m_uSurface.xwayland->window_type_len; i++)
             if (pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_DIALOG"] || pWindow->m_uSurface.xwayland->window_type[i] == HYPRATOMS["_NET_WM_WINDOW_TYPE_SPLASH"] ||
@@ -205,7 +231,9 @@ bool CHyprXWaylandManager::shouldBeFloated(CWindow* pWindow) {
         const auto SIZEHINTS = pWindow->m_uSurface.xwayland->size_hints;
         if (SIZEHINTS && (pWindow->m_uSurface.xwayland->parent || ((SIZEHINTS->min_width == SIZEHINTS->max_width) && (SIZEHINTS->min_height == SIZEHINTS->max_height))))
             return true;
-    } else {
+    } else
+#endif
+    {
         const auto PSTATE = &pWindow->m_uSurface.xdg->toplevel->current;
 
         if ((PSTATE->min_width != 0 && PSTATE->min_height != 0 && (PSTATE->min_width == PSTATE->max_width || PSTATE->min_height == PSTATE->max_height)) || pWindow->m_uSurface.xdg->toplevel->parent)
@@ -218,13 +246,15 @@ bool CHyprXWaylandManager::shouldBeFloated(CWindow* pWindow) {
 void CHyprXWaylandManager::moveXWaylandWindow(CWindow* pWindow, const Vector2D& pos) {
     if (!g_pCompositor->windowValidMapped(pWindow))
         return;
-
+#if 0
     if (pWindow->m_bIsX11) {
         wlr_xwayland_surface_configure(pWindow->m_uSurface.xwayland, pos.x, pos.y, pWindow->m_vRealSize.vec().x, pWindow->m_vRealSize.vec().y);
     }
+#endif
 }
 
 void CHyprXWaylandManager::checkBorders(CWindow* pWindow) {
+#if 0
     if (!pWindow->m_bIsX11)
         return;
 
@@ -242,12 +272,16 @@ void CHyprXWaylandManager::checkBorders(CWindow* pWindow) {
     if (pWindow->m_uSurface.xwayland->parent || pWindow->m_iX11Type == 2) {
         pWindow->m_bX11DoesntWantBorders = true;
     }
+#endif
 }
 
 void CHyprXWaylandManager::setWindowFullscreen(CWindow* pWindow, bool fullscreen) {
+#if 0
     if (pWindow->m_bIsX11) {
         wlr_xwayland_surface_set_fullscreen(pWindow->m_uSurface.xwayland, fullscreen);
-    } else {
+    } else
+#endif
+    {
         wlr_xdg_toplevel_set_fullscreen(pWindow->m_uSurface.xdg->toplevel, fullscreen);
     }
 
@@ -259,11 +293,10 @@ Vector2D CHyprXWaylandManager::getMaxSizeForWindow(CWindow* pWindow) {
     if (!g_pCompositor->windowValidMapped(pWindow))
         return Vector2D(99999, 99999);
 
-    if ((pWindow->m_bIsX11 && !pWindow->m_uSurface.xwayland->size_hints) || (!pWindow->m_bIsX11 && !pWindow->m_uSurface.xdg->toplevel))
+    if ((!pWindow->m_bIsX11 && !pWindow->m_uSurface.xdg->toplevel))
         return Vector2D(99999, 99999);
 
-    auto MAXSIZE = pWindow->m_bIsX11 ? Vector2D(pWindow->m_uSurface.xwayland->size_hints->max_width, pWindow->m_uSurface.xwayland->size_hints->max_height)
-                                     : Vector2D(pWindow->m_uSurface.xdg->toplevel->current.max_width, pWindow->m_uSurface.xdg->toplevel->current.max_height);
+    auto MAXSIZE = Vector2D(pWindow->m_uSurface.xdg->toplevel->current.max_width, pWindow->m_uSurface.xdg->toplevel->current.max_height);
 
     if (MAXSIZE.x < 5)
         MAXSIZE.x = 99999;
diff --git a/src/managers/XWaylandManager.hpp b/src/managers/XWaylandManager.hpp
index 6ac1ffd..42542b9 100644
--- a/src/managers/XWaylandManager.hpp
+++ b/src/managers/XWaylandManager.hpp
@@ -8,8 +8,6 @@ public:
     CHyprXWaylandManager();
     ~CHyprXWaylandManager();
 
-    wlr_xwayland*       m_sWLRXWayland = nullptr;
-
     wlr_surface*        getWindowSurface(CWindow*);
     void                activateSurface(wlr_surface*, bool);
     void                activateWindow(CWindow*, bool);
@@ -27,4 +25,4 @@ public:
     Vector2D            getMaxSizeForWindow(CWindow*);
 };
 
-inline std::unique_ptr<CHyprXWaylandManager> g_pXWaylandManager;
\ No newline at end of file
+inline std::unique_ptr<CHyprXWaylandManager> g_pXWaylandManager;
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 9201da2..1e9d587 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -79,8 +79,8 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
         } else {
             // Native Wayland apps know how 2 constrain themselves.
             // XWayland, we just have to accept them. Might cause issues, but thats XWayland for ya.
-            const auto CONSTRAINTPOS = CONSTRAINTWINDOW->m_bIsX11 ? Vector2D(CONSTRAINTWINDOW->m_uSurface.xwayland->x, CONSTRAINTWINDOW->m_uSurface.xwayland->y) : CONSTRAINTWINDOW->m_vRealPosition.vec();
-            const auto CONSTRAINTSIZE = CONSTRAINTWINDOW->m_bIsX11 ? Vector2D(CONSTRAINTWINDOW->m_uSurface.xwayland->width, CONSTRAINTWINDOW->m_uSurface.xwayland->height) : CONSTRAINTWINDOW->m_vRealSize.vec();
+            const auto CONSTRAINTPOS = CONSTRAINTWINDOW->m_vRealPosition.vec();
+            const auto CONSTRAINTSIZE = CONSTRAINTWINDOW->m_vRealSize.vec();
 
             if (!VECINRECT(mouseCoords, CONSTRAINTPOS.x, CONSTRAINTPOS.y, CONSTRAINTPOS.x + CONSTRAINTSIZE.x - 1.0, CONSTRAINTPOS.y + CONSTRAINTSIZE.y - 1.0)) {
                 if (g_pCompositor->m_sSeat.mouse->constraintActive) {
@@ -911,12 +911,7 @@ void CInputManager::constrainMouse(SMouse* pMouse, wlr_pointer_constraint_v1* co
 
             if (constraint->current.committed & WLR_POINTER_CONSTRAINT_V1_STATE_CURSOR_HINT) {
                 if (PWINDOW) {
-                    if (PWINDOW->m_bIsX11) {
-                        wlr_cursor_warp(g_pCompositor->m_sWLRCursor, nullptr,
-                                        constraint->current.cursor_hint.x + PWINDOW->m_uSurface.xwayland->x, PWINDOW->m_uSurface.xwayland->y + PWINDOW->m_vRealPosition.vec().y);
-
-                        wlr_seat_pointer_warp(constraint->seat, constraint->current.cursor_hint.x, constraint->current.cursor_hint.y);
-                    } else {
+                    {
                         wlr_cursor_warp(g_pCompositor->m_sWLRCursor, nullptr,
                                         constraint->current.cursor_hint.x + PWINDOW->m_vRealPosition.vec().x, constraint->current.cursor_hint.y + PWINDOW->m_vRealPosition.vec().y);
 
diff --git a/src/meson.build b/src/meson.build
index 5d64188..493f127 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -18,7 +18,6 @@ executable('Hyprland', src,
     xcb_dep,
 
     dependency('pixman-1'),
-    dependency('GL'),
     dependency('threads')
   ],
   install : true
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index a4b737f..93b074e 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -37,9 +37,7 @@ void renderSurface(struct wlr_surface* surface, int x, int y, void* data) {
     rounding -= 1; // to fix a border issue
 
     if (RDATA->surface && surface == RDATA->surface) {
-        if (wlr_surface_is_xwayland_surface(surface) && !wlr_xwayland_surface_from_wlr_surface(surface)->has_alpha && RDATA->fadeAlpha * RDATA->alpha == 255.f) {
-            g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, rounding, true);
-        } else {
+        {
             if (RDATA->blur)
                 g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, surface, rounding);
             else

@vaxerski
Copy link
Member

no, see #178

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

No branches or pull requests

3 participants