1
0
mirror of https://github.com/KDE/krfb synced 2026-07-01 07:41:17 -07:00
Commit Graph

21 Commits

Author SHA1 Message Date
Nicolas Fella
606e1a53d3 Convert license statements to SPDX 2024-08-08 11:02:04 +00:00
Nicolas Fella
b8e011dd1c Fix nativeEventFilter signature for Qt6 2024-01-08 00:55:08 +01:00
Nicolas Fella
a8b840daac Fix includes for QX11Info when using Qt6 2024-01-08 00:55:08 +01:00
Nicolas Fella
4753904c13 Remove unused include 2024-01-08 00:54:55 +01:00
Nicolas Fella
ba75f0d7ed Port framebuffers away from deprecated QDesktopWidget
Use QPlatformNativeInterface to get the WId instead
2024-01-08 00:54:53 +01:00
Nicolas Fella
04494dfeb0 Fix broken WId refactoring
Actually remove the WId member from the abtract framebuffer class and use the member in xcbframebuffer

qtframebuffer also uses the WId so add a member there
2022-08-04 11:57:55 +02:00
Nicolas Fella
4169a9f50a Don't pass unused window ids around
The wid is only relevant for the xcb framebuffer

We can just query it there, no need to pass it around everywhere
2022-08-03 22:00:16 +02:00
Laurent Montel
8365e97f9a Remove duplicate header between header cpp file 2022-05-05 07:04:45 +02:00
Laurent Montel
a9241dfe88 We can use std::as_const 2021-08-31 08:46:39 +02:00
Tobias Junghans
3a83ce6279 Use C++11 loops 2020-10-23 10:55:37 +02:00
Tobias Junghans
a109e3d6c9 Use auto keyword where possible 2020-10-23 10:54:59 +02:00
Aleix Pol
f83d5102b6 Merge branch 'release/20.08' into master 2020-09-18 22:03:29 +02:00
Stefan Brüns
024ce87b3a Compensate for global scale factor when using xcb fb plugin
The screen geometry is reported in device independent pixels, so it has
to be multiplied by the devicePixelRatio to get the size of the underlying
framebuffer. Otherwise, only the top left of the screen will be captured.

This matches the behavior of QScreen::grabWindow(...), which also
returns a QPixmap of the given size scaled by devicePixelRatio.

BUG: 419814
2020-09-15 03:03:47 +03:00
Stefan Brüns
933169b4c0 Compensate for global scale factor when using xcb fb plugin
The screen geometry is reported in device independent pixels, so it has
to be multiplied by the devicePixelRatio to get the size of the underlying
framebuffer. Otherwise, only the top left of the screen will be captured.

This matches the behavior of QScreen::grabWindow(...), which also
returns a QPixmap of the given size scaled by devicePixelRatio.

BUG: 419814
2020-08-28 04:08:15 +02:00
Stefan Brüns
76c2f08c9e Declare and use logging categories
Adds the following logging categories:
- krfb.krfb (KRFB application)
- krfb.framebuffer.qt (Qt Framebuffer plugin)
- krfb.framebuffer.xcb (XCB Framebuffer plugin)
2020-08-13 20:17:39 +02:00
Albert Astals Cid
bb59ce2776 Correctly populate max color values in server screen format
Summary:
Compute max color values from color masks, instead of relying on unreliable `bits_per_rgb_value` provided by `xcb_visualtype_t`.

In some cases (e.g. nvidia?) `bits_per_rgb_value` contains wrong value. This results in wrong max color values, and causes weird color translation inside libvncserver. Clients will see a screen which is sorta recognizable but in a complete off-color, making krfb unusable.

This is probably a bug in drivers, but x11vnc does not use this value[1], so I guess it's fair to ignore it in krfb too.

[1]: https://github.com/LibVNC/x11vnc/blob/master/src/screen.c#L3442

Reviewers: alexeymin, aacid, #kde_applications

Differential Revision: https://phabricator.kde.org/D25876
2020-01-05 19:14:24 +01:00
Friedrich W. H. Kossebau
9797ff196e Port away from foreach 2019-03-01 07:04:49 +01:00
Friedrich W. H. Kossebau
b1df09d2bf Consistently use override 2018-07-17 14:40:23 +02:00
Friedrich W. H. Kossebau
da36f0a7fb Consistently use nullptr 2018-07-17 14:38:06 +02:00
Friedrich W. H. Kossebau
798fc5c2e6 Remove unneeded moc includes 2018-07-17 14:27:20 +02:00
Alexey Min
b2cb3e8204 Implement XCB framebuffer plugin (port from x11)
Previously used x11 plugin does not compile with Qt5, because Qt5 does
not use Xlib, it uses xcb. Rewrite screen capture plugin from Xlib to
xcb.

I made xcb libs compile required dependency, but availability of X
shared memory extension is checked at runtime. It is used to effectively
get image pixels data, instead of transfering 8Mb over the wire. Xdamage
is used to limit image getting operations only within actually changed
rectangles of screen.

BUG: 377998

Tested on single-monitor system and dual-monitor, where primary monitor
does not start at (0,0) coordinate. Image transfer works fine.
Dual-monitor only has problems with receiving mouse cursor position and
clicks, but this should be fixed outside of framebuffer plugin.

Differential Revision: https://phabricator.kde.org/D5211
2017-06-15 23:21:58 +02:00