summaryrefslogtreecommitdiff
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-18 23:52:36 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-18 23:52:36 +0100
commit625e4ce264554e32975cb5f9e1d18b22640b56e6 (patch)
treedf698067896c5e6053f7c6c3005ae8762b761df9 /src/Compositor.cpp
parent5971576a50986646d7af301d8221e049f39ddb0b (diff)
fixed rendering
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 9b9643bd..7c170d13 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -1,6 +1,7 @@
#include "Compositor.hpp"
CCompositor::CCompositor() {
+
m_sWLDisplay = wl_display_create();
m_sWLRBackend = wlr_backend_autocreate(m_sWLDisplay);
@@ -36,13 +37,10 @@ CCompositor::CCompositor() {
m_sWLROutputLayout = wlr_output_layout_create();
- wl_signal_add(&m_sWLRBackend->events.new_output, &Events::listen_newOutput);
-
m_sWLRScene = wlr_scene_create();
wlr_scene_attach_output_layout(m_sWLRScene, m_sWLROutputLayout);
m_sWLRXDGShell = wlr_xdg_shell_create(m_sWLDisplay);
- wl_signal_add(&m_sWLRXDGShell->events.new_surface, &Events::listen_newXDGSurface);
m_sWLRCursor = wlr_cursor_create();
wlr_cursor_attach_output_layout(m_sWLRCursor, m_sWLROutputLayout);
@@ -50,31 +48,31 @@ CCompositor::CCompositor() {
m_sWLRXCursorMgr = wlr_xcursor_manager_create(nullptr, 24);
wlr_xcursor_manager_load(m_sWLRXCursorMgr, 1);
- wl_signal_add(&m_sWLRCursor->events.motion, &Events::listen_mouseMove);
- wl_signal_add(&m_sWLRCursor->events.motion_absolute, &Events::listen_mouseMoveAbsolute);
- wl_signal_add(&m_sWLRCursor->events.button, &Events::listen_mouseButton);
- wl_signal_add(&m_sWLRCursor->events.axis, &Events::listen_mouseAxis);
- wl_signal_add(&m_sWLRCursor->events.frame, &Events::listen_mouseFrame);
-
m_sWLRSeat = wlr_seat_create(m_sWLDisplay, "seat0");
- wl_signal_add(&m_sWLRBackend->events.new_input, &Events::listen_newInput);
- wl_signal_add(&m_sWLRSeat->events.request_set_cursor, &Events::listen_requestMouse);
- wl_signal_add(&m_sWLRSeat->events.request_set_selection, &Events::listen_requestSetSel);
-
m_sWLRPresentation = wlr_presentation_create(m_sWLDisplay, m_sWLRBackend);
m_sWLRIdle = wlr_idle_create(m_sWLDisplay);
-
- // TODO: XWayland
}
CCompositor::~CCompositor() {
}
-void CCompositor::startCompositor() {
+void CCompositor::initAllSignals() {
+ wl_signal_add(&m_sWLRBackend->events.new_output, &Events::listen_newOutput);
+ wl_signal_add(&m_sWLRXDGShell->events.new_surface, &Events::listen_newXDGSurface);
+ wl_signal_add(&m_sWLRCursor->events.motion, &Events::listen_mouseMove);
+ wl_signal_add(&m_sWLRCursor->events.motion_absolute, &Events::listen_mouseMoveAbsolute);
+ wl_signal_add(&m_sWLRCursor->events.button, &Events::listen_mouseButton);
+ wl_signal_add(&m_sWLRCursor->events.axis, &Events::listen_mouseAxis);
+ wl_signal_add(&m_sWLRCursor->events.frame, &Events::listen_mouseFrame);
+ wl_signal_add(&m_sWLRBackend->events.new_input, &Events::listen_newInput);
+ wl_signal_add(&m_sWLRSeat->events.request_set_cursor, &Events::listen_requestMouse);
+ wl_signal_add(&m_sWLRSeat->events.request_set_selection, &Events::listen_requestSetSel);
+}
+void CCompositor::startCompositor() {
// Init all the managers BEFORE we start with the wayland server so that ALL of the stuff is initialized
// properly and we dont get any bad mem reads.
//
@@ -95,6 +93,8 @@ void CCompositor::startCompositor() {
//
//
+ initAllSignals();
+
m_szWLDisplaySocket = wl_display_add_socket_auto(m_sWLDisplay);
if (!m_szWLDisplaySocket) {