Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _codeql_detected_source_root
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ void LinuxXcbPlatformEventLoop::processXcbEvents()

switch (eventType) {
case XCB_EXPOSE: {
const auto *expose = reinterpret_cast<xcb_expose_event_t *>(xcbEvent);
KD_UNUSED(expose); // Silence unused warning in Release build
[[maybe_unused]] const auto *expose = reinterpret_cast<xcb_expose_event_t *>(xcbEvent);
SPDLOG_LOGGER_DEBUG(m_logger,
"{}: Window {} exposed. Region to be redrawn at location ({}, {}), with dimension ({}, {})",
xcbEvent->sequence, expose->window, expose->x, expose->y, expose->width, expose->height);
Expand Down Expand Up @@ -257,17 +256,15 @@ void LinuxXcbPlatformEventLoop::processXcbEvents()
}

case XCB_MAP_NOTIFY: {
const auto *mapEvent = reinterpret_cast<xcb_map_notify_event_t *>(xcbEvent);
KD_UNUSED(mapEvent); // Silence unused warning in Release build
[[maybe_unused]] const auto *mapEvent = reinterpret_cast<xcb_map_notify_event_t *>(xcbEvent);
SPDLOG_LOGGER_DEBUG(m_logger,
"Map event for window {}",
mapEvent->window);
break;
}

case XCB_UNMAP_NOTIFY: {
const auto *unmapEvent = reinterpret_cast<xcb_unmap_notify_event_t *>(xcbEvent);
KD_UNUSED(unmapEvent); // Silence unused warning in Release build
[[maybe_unused]] const auto *unmapEvent = reinterpret_cast<xcb_unmap_notify_event_t *>(xcbEvent);
SPDLOG_LOGGER_DEBUG(m_logger,
"Unmap event for window {}",
unmapEvent->window);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ bool LinuxXcbPlatformIntegration::initializeXkbExtension()
return true;
}

void LinuxXcbPlatformIntegration::dumpScreenInfo(xcb_screen_t *screen)
void LinuxXcbPlatformIntegration::dumpScreenInfo([[maybe_unused]] xcb_screen_t *screen)
{
KD_UNUSED(screen); // for release builds, debug log isn't compiled in
SPDLOG_DEBUG("Information about screen {}", screen->root);
SPDLOG_DEBUG(" width.........: {}", screen->width_in_pixels);
SPDLOG_DEBUG(" height........: {}", screen->height_in_pixels);
Expand Down
18 changes: 6 additions & 12 deletions src/KDGui/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,8 @@ void Window::resizeEvent(ResizeEvent *ev)
ev->setAccepted(true);
}

void Window::mousePressEvent(MousePressEvent *ev)
void Window::mousePressEvent([[maybe_unused]] MousePressEvent *ev)
{
KD_UNUSED(ev); // for release builds, debug log isn't compiled in
SPDLOG_LOGGER_DEBUG(m_logger,
"{}() buttons = {} at pos = ({}, {})",
__FUNCTION__,
Expand All @@ -233,9 +232,8 @@ void Window::mousePressEvent(MousePressEvent *ev)
ev->yPos());
}

void Window::mouseReleaseEvent(MouseReleaseEvent *ev)
void Window::mouseReleaseEvent([[maybe_unused]] MouseReleaseEvent *ev)
{
KD_UNUSED(ev); // for release builds, debug log isn't compiled in
SPDLOG_LOGGER_DEBUG(m_logger,
"{}() buttons = {} at pos = ({}, {})",
__FUNCTION__,
Expand All @@ -244,9 +242,8 @@ void Window::mouseReleaseEvent(MouseReleaseEvent *ev)
ev->yPos());
}

void Window::mouseMoveEvent(MouseMoveEvent *ev)
void Window::mouseMoveEvent([[maybe_unused]] MouseMoveEvent *ev)
{
KD_UNUSED(ev); // for release builds, debug log isn't compiled in
SPDLOG_LOGGER_DEBUG(m_logger,
"{}() buttons = {} at pos = ({}, {})",
__FUNCTION__,
Expand All @@ -255,24 +252,21 @@ void Window::mouseMoveEvent(MouseMoveEvent *ev)
ev->yPos());
}

void Window::mouseWheelEvent(MouseWheelEvent *ev)
void Window::mouseWheelEvent([[maybe_unused]] MouseWheelEvent *ev)
{
KD_UNUSED(ev); // for release builds, debug log isn't compiled in
SPDLOG_LOGGER_DEBUG(m_logger,
"{}() xDelta = {} yDelta = {}",
__FUNCTION__,
ev->xDelta(),
ev->yDelta());
}

void Window::keyPressEvent(KeyPressEvent *ev)
void Window::keyPressEvent([[maybe_unused]] KeyPressEvent *ev)
{
KD_UNUSED(ev); // for release builds, debug log isn't compiled in
SPDLOG_LOGGER_DEBUG(m_logger, "{}() key = {}", __FUNCTION__, ev->key());
}

void Window::keyReleaseEvent(KeyReleaseEvent *ev)
void Window::keyReleaseEvent([[maybe_unused]] KeyReleaseEvent *ev)
{
KD_UNUSED(ev); // for release builds, debug log isn't compiled in
SPDLOG_LOGGER_DEBUG(m_logger, "{}() key = {}", __FUNCTION__, ev->key());
}