Skip to content

Commit

Permalink
DEBUG: logging
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickTaibel committed Nov 24, 2023
1 parent b48034b commit 81da1b7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/events/Windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,7 @@ void Events::listener_configureX11(void* owner, void* data) {
const auto E = (wlr_xwayland_surface_configure_event*)data;

if (!PWINDOW->m_uSurface.xwayland->surface || !PWINDOW->m_uSurface.xwayland->surface->mapped || !PWINDOW->m_bMappedX11) {
Debug::log(LOG, "PTA: configure 1");
wlr_xwayland_surface_configure(PWINDOW->m_uSurface.xwayland, E->x, E->y, E->width, E->height);
PWINDOW->m_vReportedSize = {E->width, E->height};
return;
Expand All @@ -1027,12 +1028,15 @@ void Events::listener_configureX11(void* owner, void* data) {
g_pHyprRenderer->damageWindow(PWINDOW);

if (!PWINDOW->m_bIsFloating || PWINDOW->m_bIsFullscreen || g_pInputManager->currentlyDraggedWindow == PWINDOW) {
Debug::log(LOG, "PTA: configure 2");
g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.goalv(), true);
g_pInputManager->refocus();
g_pHyprRenderer->damageWindow(PWINDOW);
return;
}

Debug::log(LOG, "PTA: configure 3 %ix%i", (int)E->x, (int)E->y);

if (E->width > 1 && E->height > 1)
PWINDOW->setHidden(false);
else
Expand Down
8 changes: 7 additions & 1 deletion src/layout/IHyprLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ void IHyprLayout::onWindowCreatedFloating(CWindow* pWindow) {
void IHyprLayout::onBeginDragWindow() {
const auto DRAGGINGWINDOW = g_pInputManager->currentlyDraggedWindow;

Debug::log(LOG, "PTA: Drag start");

m_vBeginDragSizeXY = Vector2D();

// Window will be floating. Let's check if it's valid. It should be, but I don't like crashing.
Expand Down Expand Up @@ -206,6 +208,8 @@ void IHyprLayout::onBeginDragWindow() {
m_vBeginDragSizeXY = DRAGGINGWINDOW->m_vRealSize.goalv();
m_vLastDragXY = m_vBeginDragXY;

Debug::log(LOG, "PTA move begin: %ix%i", (int)m_vBeginDragSizeXY.x, (int)m_vBeginDragSizeXY.y);

// get the grab corner
if (m_vBeginDragXY.x < m_vBeginDragPositionXY.x + m_vBeginDragSizeXY.x / 2.0) {
if (m_vBeginDragXY.y < m_vBeginDragPositionXY.y + m_vBeginDragSizeXY.y / 2.0) {
Expand Down Expand Up @@ -239,6 +243,8 @@ void IHyprLayout::onBeginDragWindow() {
void IHyprLayout::onEndDragWindow() {
const auto DRAGGINGWINDOW = g_pInputManager->currentlyDraggedWindow;

Debug::log(LOG, "PTA: Drag end");

if (!g_pCompositor->windowValidMapped(DRAGGINGWINDOW)) {
if (DRAGGINGWINDOW) {
g_pInputManager->unsetCursorImage();
Expand Down Expand Up @@ -304,7 +310,7 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) {
return;
}

//Debug::log(LOG, "PTA move: %ix%i", (int)mousePos.x, (int)mousePos.y);
Debug::log(LOG, "PTA move: %ix%i", (int)mousePos.x, (int)mousePos.y);

static auto TIMER = std::chrono::high_resolution_clock::now();

Expand Down
2 changes: 2 additions & 0 deletions src/managers/XWaylandManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ void CHyprXWaylandManager::setWindowSize(CWindow* pWindow, Vector2D size, bool f
size = size * scaleFactor;
}

Debug::log(LOG, "PTA: set window size %ix%i; %ix%i", (int)windowPos.x, (int)windowPos.y, (int)pWindow->m_vRealPosition.vec().x, (int)pWindow->m_vRealPosition.vec().y);

if (pWindow->m_bIsX11)
wlr_xwayland_surface_configure(pWindow->m_uSurface.xwayland, windowPos.x, windowPos.y, size.x, size.y);
else
Expand Down

0 comments on commit 81da1b7

Please sign in to comment.