Skip to content

Commit

Permalink
#3390 simplify evdi build
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Mar 1, 2023
1 parent 3cc7bba commit b7481ea
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,6 @@ def add_cython_ext(*_args, **_kwargs): # pylint: disable=function-redefined
tace(client_ENABLED and gtk3_ENABLED, "xpra.client.gtk3.cairo_workaround", "py3cairo")



#build tests, but don't install them:
toggle_packages(tests_ENABLED, "unit")

Expand Down Expand Up @@ -2263,7 +2262,7 @@ def nvcc_compile(nvcc_cmd):
tace(argb_ENABLED, "xpra.codecs.argb.argb", optimize=3)
toggle_packages(evdi_ENABLED, "xpra.codecs.evdi")

tace(evdi_ENABLED, "xpra.codecs.evdi.capture,xpra/codecs/evdi/evdi_compat.c", "evdi", language="c++")
tace(evdi_ENABLED, "xpra.codecs.evdi.capture", "evdi", language="c++")
toggle_packages(drm_ENABLED, "xpra.codecs.drm")
tace(drm_ENABLED, "xpra.codecs.drm.drm", "libdrm")
toggle_packages(enc_x264_ENABLED, "xpra.codecs.x264")
Expand Down
2 changes: 1 addition & 1 deletion xpra/codecs/evdi/capture.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ cdef extern from "evdi_lib.h":
evdi_selectable evdi_get_event_ready(evdi_handle handle)
void evdi_set_logging(evdi_logging evdi_logging)

cdef extern from "evdi_compat.c":
cdef extern from "evdi_compat.h":
void evdi_connect_compat(evdi_handle handle, const unsigned char *edid,
const unsigned int edid_length,
const uint32_t pixel_area_limit,
Expand Down
31 changes: 31 additions & 0 deletions xpra/codecs/evdi/evdi_compat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* This file is part of Xpra.
* Copyright (C) 2022 Antoine Martin <antoine@xpra.org>
* Xpra is released under the terms of the GNU GPL v2, or, at your option, any
* later version. See the file COPYING for details.
*/

#include <stdint.h>
#include "evdi_lib.h"

void evdi_connect_compat(evdi_handle handle, const unsigned char *edid,
const unsigned int edid_length,
const uint32_t pixel_area_limit,
const uint32_t pixel_per_second_limit) {
#if LIBEVDI_VERSION_MAJOR>1 || LIBEVDI_VERSION_MINOR>11
return evdi_connect(handle, edid, edid_length, pixel_area_limit, pixel_per_second_limit);
#else
return evdi_connect(handle, edid, edid_length, pixel_per_second_limit);
#endif
}

void evdi_enable_cursor_events_compat(evdi_handle handle, int enable) {
#if LIBEVDI_VERSION_MAJOR>1 || LIBEVDI_VERSION_MINOR>9 || (LIBEVDI_VERSION_MINOR==9 && LIBEVDI_VERSION_PATCH>0)
evdi_enable_cursor_events(handle, enable);
#else
//cannot be disabled with older API versions!
if (enable) {
evdi_enable_cursor_events(handle);
}
#endif
}

0 comments on commit b7481ea

Please sign in to comment.