RandR has two sets of screen geometry information:
1. CRTC. These are the physical scanout engines in the hardware
2. Monitors. These are the logical partitions of the screen.
By default, each CRTC gets mapped to a Monitor. However, some monitors
actually require two CRTCs to drive them due to limitations in the
scanout hardware. Users can also create 'virtual' monitors to support
VNC or other systems.
This patch makes the RandR code prefer the Monitor mechanism to the
older CRTC mechanism. If the server doesn't support a new enough RandR
version, the existing CRTC code is used instead.
The name of the monitor is also provided in place of the arbitrary
number to help users select the desired source.
Signed-off-by: Keith Packard <keithp@keithp.com>
When cropping the left or top of a window capture, OBS would misalign
the drawn cursor, placing it as if the entire window were being
captured. Instead, offset the captured cursor by the same number of
pixels, thus placing the cursor back where it belongs.
Move xlock after initial window listing
- XErrorLock uses static fields so when you use them recursively
they collide and do weird things. This keeps the two xlocks from
colliding.
Build obs textures based on returned pixmap texture types to ensure
compatibility during copies. (prevents glCopyImageSubData failed due to
texture incompatibilities)
Fix alpha check by using pixmap depth instead of checking channel sizes
(wrong on nvidia and maybe amd hardware)
Fix X error checking, now you will get 1 BadAlloc when pixmap allocation
fails instead "glCopyImageSubData failed" every frame. (occurs on Gnome
under special circumstances)
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed. Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
Rather than inheriting the exact visuals from the window,
find whether the color buffer has alpha, find a config with
the necessary attributes for capture, and match its depth to
the depth of the window instead of the color buffer. Also,
cleanup glxpixmap texture binding before destroying the texture.
Update: Style conformancy changes
Previously toggled swapRedBlue every update regardless of settings being set, which resulted in
moving or resizing of windows causing undesired color-swapping behavior. Also now use more direct
method of comparing visualIDs without type-casting and base the glxpixmap attributes on texture
format being used rather than the bit-depth of the window.
Adds support for windows with alpha channels as well as swapping red
and blue when using GS_BGRX. glXFBConfig now attempts to inherit
its format from the captured window when possible.
Change log message
Some window managers like i3 don't issue Expose events when switching
between workspaces, but send VisibilityNotify events. This causes the
stream to freeze even when the workspace is switched back.
Related issue: #863
It seems that it is not possible to create multiple OpenGL textures
for the same window. When sources are duplicated in studio mode this
causes window capture sources to become black. The
OBS_SOURCE_DO_NOT_DUPLICATE flag prevents that this happens.
If window capture fails to find a window with a matching title, search
for a window with the same window class additionally as a backup.
Replaces the third part of the internal window string with the class
name instead of the program path due to the fact that the program path
rarely seemed to work.