mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
Chases: 756ecf8ee9f1e75bc7b8297dc84f97c7d699174b backend/wayland: use request_state when toplevel is resized Chases: 3ef68a484243555b020200c6f95246d994932c3f backend/x11: use request_state when window is resized Ref: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/2693 We now delay requested resolution changes by the backend until the next frame event which causes us to render the new content on the already enlarged buffer. Before this change, an empty (black) buffer would have been shown instead before the next frame event caused a new render of the actual contents. Keep commiting the new state and then scheduling a frame event would not help as due to the commit call it would still show an empty buffer in the meantime. Just modifying wlr_output->pending wouldn't work either because wlr_scene_output_commit() *completely* ignores it (and it will be removed in future wlroots commits). For this reason we move to wlr_scene_output_build_state() directly because it allows us to supply the current wlr_output->pending state and thus apply any resolution change in lockstep with new rendering. Result: No more flickering in the wayland backend and resizing is again smooth as butter. This prevents constant flicker while resizing when running nested via the wayland backend. For the X11 backend (can be tested via `WLR_BACKENDS=x11 labwc`), it is still rather janky but at least doesn't cause endless self- resizing anymore.
137 lines
3.1 KiB
Meson
137 lines
3.1 KiB
Meson
project(
|
|
'labwc',
|
|
'c',
|
|
version: '0.6.6',
|
|
license: 'GPL-2.0-only',
|
|
meson_version: '>=0.59.0',
|
|
default_options: [
|
|
'c_std=c11',
|
|
'warning_level=2',
|
|
],
|
|
)
|
|
|
|
add_project_arguments(
|
|
[
|
|
'-DWLR_USE_UNSTABLE',
|
|
],
|
|
language: 'c',
|
|
)
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
add_project_arguments(cc.get_supported_arguments([
|
|
'-Wundef',
|
|
'-Wlogical-op',
|
|
'-Wmissing-include-dirs',
|
|
'-Wold-style-definition',
|
|
'-Wpointer-arith',
|
|
'-Winit-self',
|
|
'-Wstrict-prototypes',
|
|
'-Wimplicit-fallthrough=2',
|
|
'-Wendif-labels',
|
|
'-Wstrict-aliasing=2',
|
|
'-Woverflow',
|
|
'-Wmissing-prototypes',
|
|
'-Walloca',
|
|
'-Wunused-macros',
|
|
|
|
'-Wno-unused-parameter',
|
|
]), language: 'c')
|
|
|
|
version='"@0@"'.format(meson.project_version())
|
|
git = find_program('git', native: true, required: false)
|
|
if git.found()
|
|
git_commit = run_command([git, 'describe', '--dirty'], check: false)
|
|
if git_commit.returncode() == 0
|
|
version = '"@0@"'.format(git_commit.stdout().strip())
|
|
endif
|
|
endif
|
|
add_project_arguments('-DLABWC_VERSION=@0@'.format(version), language: 'c')
|
|
|
|
wlroots = dependency(
|
|
'wlroots',
|
|
default_options: ['default_library=static', 'examples=false'],
|
|
version: ['>=0.17.0', '<0.18.0'],
|
|
)
|
|
|
|
wlroots_has_xwayland = wlroots.get_variable('have_xwayland') == 'true'
|
|
|
|
wayland_server = dependency('wayland-server', version: '>=1.19.0')
|
|
wayland_protos = dependency('wayland-protocols')
|
|
xkbcommon = dependency('xkbcommon')
|
|
xcb = dependency('xcb', required: get_option('xwayland'))
|
|
xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland'))
|
|
drm_full = dependency('libdrm')
|
|
drm = drm_full.partial_dependency(compile_args: true, includes: true)
|
|
xml2 = dependency('libxml-2.0')
|
|
glib = dependency('glib-2.0')
|
|
cairo = dependency('cairo')
|
|
pangocairo = dependency('pangocairo')
|
|
input = dependency('libinput', version: '>=1.14')
|
|
pixman = dependency('pixman-1')
|
|
math = cc.find_library('m')
|
|
png = dependency('libpng')
|
|
svg = dependency('librsvg-2.0', version: '>=2.46', required: false)
|
|
|
|
if get_option('xwayland').enabled() and not wlroots_has_xwayland
|
|
error('no wlroots Xwayland support')
|
|
endif
|
|
have_xwayland = xcb.found() and wlroots_has_xwayland
|
|
conf_data = configuration_data()
|
|
conf_data.set10('HAVE_XWAYLAND', have_xwayland)
|
|
|
|
if get_option('svg').disabled()
|
|
have_rsvg = false
|
|
else
|
|
have_rsvg = svg.found()
|
|
endif
|
|
conf_data.set10('HAVE_RSVG', have_rsvg)
|
|
|
|
msgfmt = find_program('msgfmt', required: get_option('nls'))
|
|
if msgfmt.found()
|
|
source_root = meson.current_source_dir()
|
|
conf_data.set('HAVE_NLS', 1)
|
|
subdir('po')
|
|
else
|
|
conf_data.set('HAVE_NLS', 0)
|
|
endif
|
|
|
|
labwc_inc = include_directories('include')
|
|
|
|
subdir('protocols')
|
|
|
|
labwc_deps = [
|
|
server_protos,
|
|
wayland_server,
|
|
wlroots,
|
|
xkbcommon,
|
|
xcb_icccm,
|
|
xml2,
|
|
glib,
|
|
cairo,
|
|
drm,
|
|
pangocairo,
|
|
input,
|
|
pixman,
|
|
math,
|
|
png,
|
|
]
|
|
if have_rsvg
|
|
labwc_deps += [
|
|
svg,
|
|
]
|
|
endif
|
|
|
|
subdir('include')
|
|
subdir('src')
|
|
subdir('docs')
|
|
|
|
executable(
|
|
meson.project_name(),
|
|
labwc_sources,
|
|
include_directories: [labwc_inc],
|
|
dependencies: labwc_deps,
|
|
install: true,
|
|
)
|
|
|
|
install_data('docs/labwc.desktop', install_dir: get_option('datadir') / 'wayland-sessions')
|