mirror of
https://github.com/fltk/fltk.git
synced 2026-05-26 10:07:06 +08:00
Wayland platform: remove redirection of stderr.
This commit is contained in:
@@ -44,10 +44,10 @@ depend:
|
||||
: echo "libdecor/build: make depend..."
|
||||
|
||||
fl_libdecor.o : fl_libdecor.c ../src/libdecor.c ../../src/xdg-shell-protocol.c ../../src/xdg-decoration-protocol.c ../../src/text-input-protocol.c
|
||||
$(CC) $(CFLAGS) $(CFLAGS_DECOR) -c fl_libdecor.c -DLIBDECOR_PLUGIN_API_VERSION=1 -DLIBDECOR_PLUGIN_DIR=\"/usr/local/lib/libdecor/plugins-1\"
|
||||
$(CC) $(CFLAGS) $(CFLAGS_DECOR) -c fl_libdecor.c -DLIBDECOR_PLUGIN_API_VERSION=1 -DLIBDECOR_PLUGIN_DIR=\"\"
|
||||
|
||||
fl_libdecor-plugins.o : fl_libdecor-plugins.c ../src/plugins/cairo/libdecor-cairo.c
|
||||
$(CC) $(CFLAGS) $(CFLAGS_DECOR) -c fl_libdecor-plugins.c -DLIBDECOR_PLUGIN_API_VERSION=1 -DLIBDECOR_PLUGIN_DIR=\"/usr/local/lib/libdecor/plugins-1\"
|
||||
$(CC) $(CFLAGS) $(CFLAGS_DECOR) -c fl_libdecor-plugins.c -DLIBDECOR_PLUGIN_API_VERSION=1 -DLIBDECOR_PLUGIN_DIR=\"\"
|
||||
|
||||
libdecor-cairo-blur.o : ../src/plugins/cairo/libdecor-cairo-blur.c
|
||||
$(CC) $(CFLAGS_DECOR) -c ../src/plugins/cairo/libdecor-cairo-blur.c
|
||||
|
||||
@@ -111,16 +111,12 @@ LIBDECOR_EXPORT struct libdecor *libdecor_new(struct wl_display *wl_display, str
|
||||
wl_callback_add_listener(context->init_callback, &init_wl_display_callback_listener, context);
|
||||
wl_list_init(&context->frames);
|
||||
// attempt to dynamically load a libdecor plugin with dlopen()
|
||||
FILE *old_stderr = stderr;
|
||||
stderr = fopen("/dev/null", "w+"); // avoid "Couldn't open plugin directory" messages
|
||||
if (init_plugins(context) != 0) { // attempt to load plugin by dlopen()
|
||||
// no plug-in was found by dlopen(), use built-in plugin instead
|
||||
// defined in the source code of the built-in plugin: libdecor-cairo.c or libdecor-gtk.c
|
||||
extern const struct libdecor_plugin_description libdecor_plugin_description;
|
||||
context->plugin = libdecor_plugin_description.constructor(context);
|
||||
}
|
||||
fclose(stderr); // restore stderr as it was before
|
||||
stderr = old_stderr;
|
||||
|
||||
wl_display_flush(wl_display);
|
||||
return context;
|
||||
|
||||
+1
-1
@@ -502,7 +502,7 @@ if (OPTION_USE_WAYLAND)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLIBDECOR_PLUGIN_DIR=${LIBDECOR_PLUGIN_DIR} ")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_SYSTEM_LIBDECOR")
|
||||
else()
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}/../libdecor/src -DLIBDECOR_PLUGIN_API_VERSION=1 -DLIBDECOR_PLUGIN_DIR=\\\"/usr/local/lib/libdecor/plugins-1\\\" ")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}/../libdecor/src -DLIBDECOR_PLUGIN_API_VERSION=1 -DLIBDECOR_PLUGIN_DIR=\\\"\\\" ")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_SYSTEM_LIBDECOR=0 -DHAVE_MEMFD_CREATE -DHAVE_MKOSTEMP -DHAVE_POSIX_FALLOCATE")
|
||||
endif (OPTION_USE_SYSTEM_LIBDECOR)
|
||||
|
||||
|
||||
@@ -1119,6 +1119,7 @@ void Fl_Wayland_Screen_Driver::open_display_platform() {
|
||||
Fl::fatal("No Wayland connection\n");
|
||||
}
|
||||
}
|
||||
puts("Using Wayland backend");
|
||||
wl_list_init(&seats);
|
||||
wl_list_init(&outputs);
|
||||
|
||||
@@ -1135,7 +1136,6 @@ void Fl_Wayland_Screen_Driver::open_display_platform() {
|
||||
Fl::add_fd(wl_display_get_fd(wl_display), FL_READ, (Fl_FD_Handler)fd_callback, wl_display);
|
||||
fl_create_print_window();
|
||||
Fl_Wayland_System_Driver::too_late_to_disable = true;
|
||||
puts("Using Wayland backend");
|
||||
}
|
||||
|
||||
void Fl_Wayland_Screen_Driver::close_display() {
|
||||
|
||||
Reference in New Issue
Block a user