lightpad icon indicating copy to clipboard operation
lightpad copied to clipboard

crashes on sway/wayland

Open RiedleroD opened this issue 4 years ago • 1 comments

I'm getting this output (info level messages removed):

(com.github.libredeb.lightpad:269702): Gdk-CRITICAL **: 11:07:31.185: gdk_monitor_get_geometry: assertion 'GDK_IS_MONITOR (monitor)' failed

(com.github.libredeb.lightpad:269702): Gdk-WARNING **: 11:07:31.646: Native Windows wider than 65535 pixels are not supported

(com.github.libredeb.lightpad:269702): Gdk-CRITICAL **: 11:07:31.665: ../gtk/gdk/wayland/gdkdisplay-wayland.c:1407: Unable to create Cairo image surface: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Segmentation fault (core dumped)

I'm trying to get this working on Arch (installed lightpad 0.0.8-2 from yay) running on Sway 1:1.5.1-1 with XWayland 1.20.0.r800.ge4a9f0bb4-1 and waybar 0.9.5-2 installed. Other gtk applications are running without problems (aside from the occasional warning but eh).

I hope you can identify the problem.

RiedleroD avatar Jan 23 '21 10:01 RiedleroD

@RiedleroD I'm no anexpert, but it may be that the compositor Sway doesn't handle "monitors" as such, clearly the error message says that... I'll try to put together in a VM and try to replicate the error to see if it can be fixed.

As a side note as workaround, you can compile LightPad by following the instructions and coding the exact measurements of your monitor (width and height in pixels) in the code. Example:

https://github.com/libredeb/lightpad/blob/5591802094743377f04c645563f8dd6ad108aa68/src/Application.vala#L59 https://github.com/libredeb/lightpad/blob/5591802094743377f04c645563f8dd6ad108aa68/src/Application.vala#L60

You can replace pixel_geo.width and pixel_geo.height with exaclty with the exact pixel measurements of your monitor. I mean:

        monitor_dimensions.width = 1920 / monitor.get_scale_factor ();
        monitor_dimensions.height = 1080 / monitor.get_scale_factor ();

before compiling. That should work.

libredeb avatar Jan 28 '21 03:01 libredeb