[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1115386: xwayland: XRandr on XWayland reports wrong monitor resolution



Package: xwayland
Version: 2:24.1.6-1
Severity: important
X-Debbugs-Cc: akallabeth+debian@posteo.net

Dear Maintainer,

I hope this is the correct package, but the bug only appears when using
XWayland.

I have a dual monitor setup (pretty standard, no scaling, 3840x2160 resolution,
side by side) and am using XRRGetMonitors in my applicaton (FreeRDP)
(appended is a simple test program just dumping the monitors)

so, now I get different resolution/offset depending on when running X11 or
XWayland.
With X11 the output of the attached test program is sane, e.g.
There are 2 monitor(s) in system.
name:   DisplayPort-3
x:      0
y:      0
width:  3840
height: 2160
name:   DisplayPort-3
x:      3840
y:      0
width:  3840
height: 2160

whereas with XWayland I get
There are 2 monitor(s) in system.
name:   DP-3
x:      0
y:      0
width:  3840
height: 2160
name:   DP-3
x:      3840
y:      0
width:  7680
height: 4320

which is definitely wrong.
Did try to build the newer version from sid, but dpkg-buildpackage did fail.


-- System Information:
Debian Release: 13.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.43+deb13-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages xwayland depends on:
ii  libc6               2.41-12
ii  libdecor-0-0        0.2.2-2
ii  libdrm2             2.4.124-2
ii  libepoxy0           1.5.10-2
ii  libgbm1             25.0.7-2
ii  libgcrypt20         1.11.0-7
ii  libgl1              1.7.0-1+b2
ii  libpixman-1-0       0.44.0-3
ii  libtirpc3t64        1.3.6+ds-1
ii  libwayland-client0  1.23.1-3
ii  libxau6             1:1.0.11-1
ii  libxcvt0            0.1.3-1
ii  libxdmcp6           1:1.1.5-1
ii  libxfont2           1:2.0.6-1+b3
ii  libxshmfence1       1.3.3-1
ii  xserver-common      2:21.1.16-1.3

xwayland recommends no packages.

xwayland suggests no packages.

-- no debconf information

*** /home/nin/src/XRRTester/main.cpp
#include <X11/Xlib.h>
#include <iostream>
#include <X11/extensions/Xrandr.h>

int main()
{
    int monitor_count = 0;

    auto display = XOpenDisplay(NULL);
    if (display == NULL)
    {
        std::cout << "Failed to open display!" << std::endl;
        return -1;
    }

    auto wnd = XDefaultRootWindow(display);

    // 0 = active, 1 = inactive, call it twice to get a full list, if there are
    // inactive monitors
    auto info = XRRGetMonitors(display, wnd, 0, &monitor_count);
    std::cout << "There are " << monitor_count << " monitor(s) in system." << std::endl;

    for (auto x=0; x<monitor_count; x++) {
        const auto& cur = info[x];
        std::cout << "name:   " << XGetAtomName(display, info->name) << std::endl;
        std::cout << "x:      " << cur.x << std::endl;
        std::cout << "y:      " << cur.y << std::endl;
        std::cout << "width:  " << cur.width << std::endl;
        std::cout << "height: " << cur.height << std::endl;
    }
    XCloseDisplay(display);
}

*** /home/nin/src/XRRTester/CMakeLists.txt
cmake_minimum_required(VERSION 3.16)

project(XRRTester LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(X11 REQUIRED)

add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE X11::X11 X11::Xrandr)

include(GNUInstallDirs)
install(TARGETS ${PROJECT_NAME}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
cmake_minimum_required(VERSION 3.16)

project(XRRTester LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(X11 REQUIRED)

add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE X11::X11 X11::Xrandr)

include(GNUInstallDirs)
install(TARGETS ${PROJECT_NAME}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
#include <X11/Xlib.h>
#include <iostream>
#include <X11/extensions/Xrandr.h>

int main()
{
    int monitor_count = 0;

    auto display = XOpenDisplay(NULL);
    if (display == NULL)
    {
        std::cout << "Failed to open display!" << std::endl;
        return -1;
    }

    auto wnd = XDefaultRootWindow(display);

    // 0 = active, 1 = inactive, call it twice to get a full list, if there are
    // inactive monitors
    auto info = XRRGetMonitors(display, wnd, 0, &monitor_count);
    std::cout << "There are " << monitor_count << " monitor(s) in system." << std::endl;

    for (auto x=0; x<monitor_count; x++) {
        const auto& cur = info[x];
        std::cout << "name:   " << XGetAtomName(display, info->name) << std::endl;
        std::cout << "x:      " << cur.x << std::endl;
        std::cout << "y:      " << cur.y << std::endl;
        std::cout << "width:  " << cur.width << std::endl;
        std::cout << "height: " << cur.height << std::endl;
    }
    XCloseDisplay(display);
}

Reply to: