mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-07 22:26:00 +01:00
Fix GDK window extents mouse offset
kind of...? Should work more or less
This commit is contained in:
parent
ddab8e60dc
commit
96819c8ab9
5 changed files with 17 additions and 5 deletions
|
@ -83,8 +83,9 @@ CCompositor::CCompositor() {
|
||||||
|
|
||||||
m_sWLRLayerShell = wlr_layer_shell_v1_create(m_sWLDisplay);
|
m_sWLRLayerShell = wlr_layer_shell_v1_create(m_sWLDisplay);
|
||||||
|
|
||||||
wlr_server_decoration_manager_set_default_mode(wlr_server_decoration_manager_create(m_sWLDisplay), WLR_SERVER_DECORATION_MANAGER_MODE_SERVER);
|
m_sWLRServerDecoMgr = wlr_server_decoration_manager_create(m_sWLDisplay);
|
||||||
wlr_xdg_decoration_manager_v1_create(m_sWLDisplay);
|
m_sWLRXDGDecoMgr = wlr_xdg_decoration_manager_v1_create(m_sWLDisplay);
|
||||||
|
wlr_server_decoration_manager_set_default_mode(m_sWLRServerDecoMgr, WLR_SERVER_DECORATION_MANAGER_MODE_SERVER);
|
||||||
|
|
||||||
wlr_xdg_output_manager_v1_create(m_sWLDisplay, m_sWLROutputLayout);
|
wlr_xdg_output_manager_v1_create(m_sWLDisplay, m_sWLROutputLayout);
|
||||||
m_sWLROutputMgr = wlr_output_manager_v1_create(m_sWLDisplay);
|
m_sWLROutputMgr = wlr_output_manager_v1_create(m_sWLDisplay);
|
||||||
|
@ -130,6 +131,7 @@ void CCompositor::initAllSignals() {
|
||||||
addWLSignal(&m_sWLRInhibitMgr->events.activate, &Events::listen_InhibitActivate, m_sWLRInhibitMgr, "InhibitMgr");
|
addWLSignal(&m_sWLRInhibitMgr->events.activate, &Events::listen_InhibitActivate, m_sWLRInhibitMgr, "InhibitMgr");
|
||||||
addWLSignal(&m_sWLRInhibitMgr->events.deactivate, &Events::listen_InhibitDeactivate, m_sWLRInhibitMgr, "InhibitMgr");
|
addWLSignal(&m_sWLRInhibitMgr->events.deactivate, &Events::listen_InhibitDeactivate, m_sWLRInhibitMgr, "InhibitMgr");
|
||||||
addWLSignal(&m_sWLRPointerConstraints->events.new_constraint, &Events::listen_newConstraint, m_sWLRPointerConstraints, "PointerConstraints");
|
addWLSignal(&m_sWLRPointerConstraints->events.new_constraint, &Events::listen_newConstraint, m_sWLRPointerConstraints, "PointerConstraints");
|
||||||
|
addWLSignal(&m_sWLRXDGDecoMgr->events.new_toplevel_decoration, &Events::listen_NewXDGDeco, m_sWLRXDGDecoMgr, "XDGDecoMgr");
|
||||||
|
|
||||||
signal(SIGINT, handleCritSignal);
|
signal(SIGINT, handleCritSignal);
|
||||||
signal(SIGTERM, handleCritSignal);
|
signal(SIGTERM, handleCritSignal);
|
||||||
|
|
|
@ -53,6 +53,8 @@ public:
|
||||||
wlr_linux_dmabuf_v1* m_sWLRDmabuf;
|
wlr_linux_dmabuf_v1* m_sWLRDmabuf;
|
||||||
wlr_pointer_constraints_v1* m_sWLRPointerConstraints;
|
wlr_pointer_constraints_v1* m_sWLRPointerConstraints;
|
||||||
wlr_relative_pointer_manager_v1* m_sWLRRelPointerMgr;
|
wlr_relative_pointer_manager_v1* m_sWLRRelPointerMgr;
|
||||||
|
wlr_server_decoration_manager* m_sWLRServerDecoMgr;
|
||||||
|
wlr_xdg_decoration_manager_v1* m_sWLRXDGDecoMgr;
|
||||||
// ------------------------------------------------- //
|
// ------------------------------------------------- //
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -102,4 +102,7 @@ namespace Events {
|
||||||
// Inhibit
|
// Inhibit
|
||||||
LISTENER(InhibitActivate);
|
LISTENER(InhibitActivate);
|
||||||
LISTENER(InhibitDeactivate);
|
LISTENER(InhibitDeactivate);
|
||||||
|
|
||||||
|
// Deco XDG
|
||||||
|
LISTENER(NewXDGDeco);
|
||||||
};
|
};
|
|
@ -352,3 +352,8 @@ void Events::listener_newXDGSurface(wl_listener* listener, void* data) {
|
||||||
PNEWWINDOW->hyprListener_unmapWindow.initCallback(&XDGSURFACE->events.unmap, &Events::listener_unmapWindow, PNEWWINDOW, "XDG Window");
|
PNEWWINDOW->hyprListener_unmapWindow.initCallback(&XDGSURFACE->events.unmap, &Events::listener_unmapWindow, PNEWWINDOW, "XDG Window");
|
||||||
PNEWWINDOW->hyprListener_destroyWindow.initCallback(&XDGSURFACE->events.destroy, &Events::listener_destroyWindow, PNEWWINDOW, "XDG Window");
|
PNEWWINDOW->hyprListener_destroyWindow.initCallback(&XDGSURFACE->events.destroy, &Events::listener_destroyWindow, PNEWWINDOW, "XDG Window");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Events::listener_NewXDGDeco(wl_listener* listener, void* data) {
|
||||||
|
const auto WLRDECO = (wlr_xdg_toplevel_decoration_v1*)data;
|
||||||
|
wlr_xdg_toplevel_decoration_v1_set_mode(WLRDECO, WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
|
||||||
|
}
|
||||||
|
|
|
@ -118,8 +118,8 @@ void CHyprXWaylandManager::sendCloseWindow(CWindow* pWindow) {
|
||||||
void CHyprXWaylandManager::setWindowSize(CWindow* pWindow, const Vector2D& size) {
|
void CHyprXWaylandManager::setWindowSize(CWindow* pWindow, const Vector2D& size) {
|
||||||
if (pWindow->m_bIsX11)
|
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);
|
wlr_xwayland_surface_configure(pWindow->m_uSurface.xwayland, pWindow->m_vRealPosition.vec().x, pWindow->m_vRealPosition.vec().y, size.x, size.y);
|
||||||
else
|
else // vvvvv I don't know if this is fucking correct, but the fucking idea of putting shadows into a window's surface is borderline criminal.
|
||||||
wlr_xdg_toplevel_set_size(pWindow->m_uSurface.xdg->toplevel, size.x, size.y);
|
wlr_xdg_toplevel_set_size(pWindow->m_uSurface.xdg->toplevel, size.x - pWindow->m_uSurface.xdg->current.geometry.x * 2, size.y - pWindow->m_uSurface.xdg->current.geometry.y * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHyprXWaylandManager::setWindowStyleTiled(CWindow* pWindow, uint32_t edgez) {
|
void CHyprXWaylandManager::setWindowStyleTiled(CWindow* pWindow, uint32_t edgez) {
|
||||||
|
|
Loading…
Reference in a new issue