Fix whitespace errors (no code changes)
This commit is contained in:
parent
34d02a3ddf
commit
e91d65cd2f
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -49,12 +49,12 @@ jobs:
|
||||
|
||||
- name: Install prerequisites
|
||||
run: sudo apt-get update -y && sudo apt-get install -y libasound2-dev libglu1-mesa-dev libwayland-dev wayland-protocols libdbus-1-dev libxkbcommon-dev libegl-dev libpangocairo-1.0-0 libopengl-dev libpango1.0-dev libgtk-3-dev
|
||||
|
||||
|
||||
- name: Create Build Environment
|
||||
# Some projects don't allow in-source building, so create a separate build directory
|
||||
# We'll use this as our working directory for all subsequent commands
|
||||
run: cmake -E make_directory ${{github.workspace}}/build
|
||||
|
||||
|
||||
- name: Configure CMake
|
||||
# Use a bash shell so we can use the same syntax for environment variable
|
||||
# access regardless of the host operating system
|
||||
|
0
FL/wayland.H
Executable file → Normal file
0
FL/wayland.H
Executable file → Normal file
@ -44,7 +44,7 @@ Once after "git clone", create the configure file :
|
||||
|
||||
Prepare build with :
|
||||
./configure --enable-wayland [--enable-shared]
|
||||
|
||||
|
||||
Build with :
|
||||
make
|
||||
|
||||
@ -97,7 +97,7 @@ the common FLTK 1.3 construct :
|
||||
will choke at compile time because it exposes X11-specific code to the non-X11, Wayland
|
||||
environment. This should be written instead :
|
||||
#include <FL/fl_config.h>
|
||||
|
||||
|
||||
#ifdef __APPLE__
|
||||
*** macOS-specific code ***
|
||||
#elif defined(_WIN32)
|
||||
|
10
README.md
10
README.md
@ -4,11 +4,11 @@
|
||||
|
||||
The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a
|
||||
cross-platform C++ GUI toolkit for UNIX®/Linux® (X11 or
|
||||
Wayland), Microsoft® Windows®, and macOS®.
|
||||
FLTK provides modern GUI functionality without the bloat and
|
||||
supports 3D graphics via OpenGL® and its built-in GLUT
|
||||
emulation. It was originally developed by Mr. Bill Spitzak
|
||||
and is currently maintained by a small group of developers
|
||||
Wayland), Microsoft® Windows®, and macOS®.
|
||||
FLTK provides modern GUI functionality without the bloat and
|
||||
supports 3D graphics via OpenGL® and its built-in GLUT
|
||||
emulation. It was originally developed by Mr. Bill Spitzak
|
||||
and is currently maintained by a small group of developers
|
||||
across the world with a central repository on GitHub.
|
||||
|
||||
For more information see README.txt:
|
||||
|
14
configure.ac
14
configure.ac
@ -1001,7 +1001,7 @@ AS_CASE([$host_os_gui], [cygwin* | mingw*], [
|
||||
|
||||
AS_IF([test x$enable_wayland = xyes], [
|
||||
dnl Prepare for Wayland...
|
||||
|
||||
|
||||
AS_IF([test x$PKGCONFIG = x], [
|
||||
dnl pkg-config is not available, issue warning and abort...
|
||||
AC_MSG_WARN([--enable-wayland: please install pkg-config.])
|
||||
@ -1020,9 +1020,9 @@ AS_CASE([$host_os_gui], [cygwin* | mingw*], [
|
||||
enable_pango=yes
|
||||
LIBDECORDIR="libdecor/build"
|
||||
LDFLAGS="$LDFLAGS -rdynamic -no-pie"
|
||||
|
||||
|
||||
AC_SEARCH_LIBS([dlopen], [dl])
|
||||
|
||||
|
||||
AS_IF([test x$enable_gl != xno], [
|
||||
AC_CHECK_HEADER([GL/gl.h], [AC_DEFINE([HAVE_GL])])
|
||||
AC_CHECK_HEADER([GL/glu.h], [
|
||||
@ -1037,7 +1037,7 @@ AS_CASE([$host_os_gui], [cygwin* | mingw*], [
|
||||
GLDEMOS=""
|
||||
GLWLDEMO=""
|
||||
])
|
||||
|
||||
|
||||
dnl Check for GTK-3 ...
|
||||
gtk_found=no
|
||||
CFLAGS="$($PKGCONFIG --cflags gtk+-3.0) $CFLAGS"
|
||||
@ -1046,13 +1046,13 @@ AS_CASE([$host_os_gui], [cygwin* | mingw*], [
|
||||
LIBS="$LIBS $($PKGCONFIG --libs gtk+-3.0)"
|
||||
gtk_found=yes
|
||||
])
|
||||
|
||||
|
||||
dnl Check for the Pango library ...
|
||||
pango_found=no
|
||||
CFLAGS="$($PKGCONFIG --cflags pangocairo) $CFLAGS"
|
||||
CXXFLAGS="$($PKGCONFIG --cflags pangocairo) $CXXFLAGS"
|
||||
LIBS="$LIBS $($PKGCONFIG --libs pangocairo)"
|
||||
|
||||
|
||||
AC_CHECK_HEADERS([pango/pangocairo.h], [
|
||||
AC_DEFINE([USE_PANGO])
|
||||
AC_DEFINE([USE_XFT])
|
||||
@ -1265,7 +1265,7 @@ AS_CASE([$host_os_gui], [cygwin* | mingw*], [
|
||||
AC_CHECK_HEADER([X11/Xregion.h], [
|
||||
AC_DEFINE([HAVE_X11_XREGION_H])
|
||||
], [], [#include <X11/Xlib.h>])
|
||||
|
||||
|
||||
])
|
||||
|
||||
# Make symlinks since UNIX/Linux is case sensitive,
|
||||
|
@ -474,7 +474,7 @@ if (OPTION_USE_WAYLAND)
|
||||
if (GTK_FOUND)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_GTK")
|
||||
endif (GTK_FOUND)
|
||||
|
||||
|
||||
list (APPEND CFILES
|
||||
xutf8/keysym2Ucs.c
|
||||
scandir_posix.c
|
||||
|
@ -72,7 +72,7 @@
|
||||
\li make current another surface, e.g., an Fl_Printer or an Fl_Image_Surface object, calling set_current() on this object;
|
||||
\li draw to that surface;
|
||||
\li make the display current again with Fl_Display_Device::display_device()->set_current(); . Don't do any other call to set_current() before this one.
|
||||
|
||||
|
||||
Other scenarios of drawing surface changes should be performed via Fl_Surface_Device::push_current( ) / Fl_Surface_Device::pop_current().
|
||||
*/
|
||||
void Fl_Surface_Device::set_current(void)
|
||||
|
@ -184,13 +184,13 @@ public:
|
||||
int /*dest_x*/, int /*dest_y*/,
|
||||
void (*)(void*, int,int,int,int), void*) { return 0; }
|
||||
static inline Fl_Window_Driver* driver(const Fl_Window *win) {return win->pWindowDriver;}
|
||||
|
||||
|
||||
// --- support for menu windows
|
||||
// the default implementation of next 2 members is most probably enough
|
||||
virtual void reposition_menu_window(int x, int y);
|
||||
virtual void menu_window_area(int &X, int &Y, int &W, int &H, int nscreen = -1);
|
||||
static Fl_Window *menu_parent();
|
||||
|
||||
|
||||
virtual fl_uintptr_t os_id() { return 0; }
|
||||
};
|
||||
|
||||
|
@ -144,7 +144,7 @@ public:
|
||||
void ps_origin(int x, int y);
|
||||
void ps_translate(int, int);
|
||||
void ps_untranslate();
|
||||
|
||||
|
||||
void draw_cached_pattern_(Fl_Image *img, cairo_pattern_t *pat, int X, int Y, int W, int H, int cx, int cy);
|
||||
void draw_image(const uchar *data, int ix, int iy, int iw, int ih, int D, int LD);
|
||||
void draw_rgb(Fl_RGB_Image *rgb,int XP, int YP, int WP, int HP, int cx, int cy);
|
||||
@ -156,7 +156,7 @@ public:
|
||||
void cache(Fl_Pixmap *pxm);
|
||||
void draw_pixmap(Fl_Pixmap *rgb,int XP, int YP, int WP, int HP, int cx, int cy);
|
||||
void uncache_pixmap(fl_uintptr_t p);
|
||||
|
||||
|
||||
void font(Fl_Font fnum, Fl_Fontsize s);
|
||||
Fl_Font font() { return Fl_Graphics_Driver::font(); }
|
||||
void draw(const char* s, int nBytes, int x, int y) { draw(s, nBytes, float(x), float(y)); }
|
||||
|
@ -162,7 +162,7 @@ public:
|
||||
//icons
|
||||
virtual void icons(const Fl_RGB_Image *icons[], int count);
|
||||
NSImage *icon_image;
|
||||
|
||||
|
||||
virtual fl_uintptr_t os_id();
|
||||
};
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <FL/gl.h>
|
||||
|
||||
/* Implementation note about OpenGL drawing on the Wayland platform
|
||||
|
||||
|
||||
After eglCreateWindowSurface() with attributes {EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER, EGL_NONE},
|
||||
eglQueryContext() reports that EGL_RENDER_BUFFER equals EGL_BACK_BUFFER.
|
||||
This experiment suggests that the platform only supports double-buffer drawing.
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <FL/gl.h>
|
||||
|
||||
/* Implementation note about OpenGL drawing on the Wayland platform
|
||||
|
||||
|
||||
After eglCreateWindowSurface() with attributes {EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER, EGL_NONE},
|
||||
eglQueryContext() reports that EGL_RENDER_BUFFER equals EGL_BACK_BUFFER.
|
||||
This experiment suggests that the platform only supports double-buffer drawing.
|
||||
@ -61,22 +61,22 @@ Fl_Wayland_Gl_Window_Driver::Fl_Wayland_Gl_Window_Driver(Fl_Gl_Window *win) : Fl
|
||||
|
||||
void Fl_Wayland_Gl_Window_Driver::init() {
|
||||
EGLint major, minor;
|
||||
|
||||
|
||||
if (!Fl_Wayland_Screen_Driver::wl_display) Fl::screen_driver()->open_display();
|
||||
egl_display = eglGetDisplay((EGLNativeDisplayType) Fl_Wayland_Screen_Driver::wl_display);
|
||||
if (egl_display == EGL_NO_DISPLAY) {
|
||||
Fl::fatal("Can't create egl display\n");
|
||||
}
|
||||
|
||||
|
||||
if (eglInitialize(egl_display, &major, &minor) != EGL_TRUE) {
|
||||
Fl::fatal("Can't initialise egl display\n");
|
||||
}
|
||||
//printf("EGL major: %d, minor %d\n", major, minor);
|
||||
|
||||
|
||||
eglGetConfigs(egl_display, NULL, 0, &configs_count);
|
||||
//printf("EGL has %d configs\n", configs_count);
|
||||
eglBindAPI(EGL_OPENGL_API);
|
||||
|
||||
|
||||
gl_event_queue = wl_display_create_queue(Fl_Wayland_Screen_Driver::wl_display);
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ Fl_Gl_Choice *Fl_Wayland_Gl_Window_Driver::find(int m, const int *alistp)
|
||||
m |= FL_DOUBLE;
|
||||
Fl_Wayland_Gl_Choice *g = (Fl_Wayland_Gl_Choice*)Fl_Gl_Window_Driver::find_begin(m, alistp);
|
||||
if (g) return g;
|
||||
|
||||
|
||||
EGLint n;
|
||||
EGLint config_attribs[] = {
|
||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
||||
@ -128,11 +128,11 @@ Fl_Gl_Choice *Fl_Wayland_Gl_Window_Driver::find(int m, const int *alistp)
|
||||
EGL_STENCIL_SIZE, 0, // set at 15
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
|
||||
if (m & FL_DEPTH) config_attribs[11] = 1;
|
||||
if (m & FL_MULTISAMPLE) config_attribs[13] = 1;
|
||||
if (m & FL_STENCIL) config_attribs[15] = 1;
|
||||
|
||||
|
||||
static EGLConfig *configs = (void**)calloc(configs_count, sizeof(EGLConfig));
|
||||
eglChooseConfig(egl_display, config_attribs, configs, configs_count, &n);
|
||||
if (n == 0 && (m & FL_MULTISAMPLE)) {
|
||||
@ -142,7 +142,7 @@ Fl_Gl_Choice *Fl_Wayland_Gl_Window_Driver::find(int m, const int *alistp)
|
||||
if (n == 0) {
|
||||
Fl::fatal("failed to choose an EGL config\n");
|
||||
}
|
||||
|
||||
|
||||
g = new Fl_Wayland_Gl_Choice(m, alistp, first);
|
||||
/*for (int i = 0; i < n; i++) {
|
||||
EGLint size;
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
|
||||
/* Implementation note about buffers FLTK uses to support display graphics under Wayland.
|
||||
|
||||
|
||||
Each window is associated to an FLTK-defined object of type struct wld_window
|
||||
containing itself an FLTK-defined struct fl_wld_buffer object holding all graphics data.
|
||||
Among members of this latter structure are:
|
||||
@ -44,7 +44,7 @@
|
||||
gives the total buffer size in bytes (thus, data_size / stride gives the buffer height);
|
||||
- struct wl_callback *cb
|
||||
is used to synchronize drawing with the compositor during progressive drawing.
|
||||
|
||||
|
||||
When a graphics scene is to be committed, the data_size bytes of draw_buffer are copied by memcpy()
|
||||
starting at data, and wl_buffer is attached to the wl_surface which is committed for display
|
||||
by wl_surface_commit().
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
static bool insertion_point_location(int *px, int *py, int *pwidth, int *pheight);
|
||||
int get_mouse_unscaled(int &xx, int &yy);
|
||||
void screen_count(int count) {num_screens = count;}
|
||||
|
||||
|
||||
void reset_cursor();
|
||||
struct wl_cursor *xc_arrow;
|
||||
struct wl_cursor *xc_ns;
|
||||
@ -113,7 +113,7 @@ public:
|
||||
struct libdecor *libdecor_context;
|
||||
struct xdg_wm_base *xdg_wm_base;
|
||||
struct zwp_text_input_manager_v3 *text_input_base;
|
||||
|
||||
|
||||
Fl_Wayland_Screen_Driver();
|
||||
virtual APP_SCALING_CAPABILITY rescalable() { return PER_SCREEN_APP_SCALING; }
|
||||
virtual float scale(int n);
|
||||
|
@ -52,16 +52,16 @@ struct pointer_output {
|
||||
};
|
||||
|
||||
/* Implementation note about support of 3 Wayland compositors: Mutter, Weston, KDE.
|
||||
|
||||
|
||||
- About CSD and SSD :
|
||||
* Mutter and Weston use CSD (client-side decoration) which means that libdecor.so draws all window
|
||||
titlebars and responds to resize, minimization and maximization events.
|
||||
* KDE uses SSD (server-side decoration) which means the OS draws titlebars according to its own rules
|
||||
and triggers resize, minimization and maximization events.
|
||||
|
||||
|
||||
- Function registry_handle_global() runs within fl_open_display() and sets public static variable
|
||||
Fl_Wayland_Screen_Driver::compositor to either Fl_Wayland_Screen_Driver::MUTTER, ::WESTON, or ::KDE.
|
||||
|
||||
|
||||
- Specific operations for WESTON:
|
||||
* When a libdecor-framed window is minimized under Weston, the frame remains on display. To avoid
|
||||
that, function libdecor_frame_set_minimized() is modified so it turns off the frame's visibility, with
|
||||
@ -82,7 +82,7 @@ struct pointer_output {
|
||||
A frame callback is also created by Fl_Wayland_Window_Driver::flush() when a window redraw operation
|
||||
is needed. FLTK processes wayland events until the compositor is ready for commit and then commits
|
||||
the new window content.
|
||||
|
||||
|
||||
- Support of Fl_Window::border(int) :
|
||||
FLTK uses libdecor_frame_set_visibility() to show or hide a toplevel window's frame. This doesn't work
|
||||
with KDE which uses Server-Side Decoration. In that case, FLTK hides and re-shows the window to toggle
|
||||
@ -91,7 +91,7 @@ struct pointer_output {
|
||||
|
||||
|
||||
/* Implementation note about screen-related information
|
||||
|
||||
|
||||
struct wl_output : Wayland-defined, contains info about a screen, one such record for each screen
|
||||
|
||||
struct Fl_Wayland_Screen_Driver::output { // FLTK defined
|
||||
@ -488,15 +488,15 @@ static void wl_keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard,
|
||||
{
|
||||
struct seat *seat = (struct seat*)data;
|
||||
assert(format == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1);
|
||||
|
||||
|
||||
char *map_shm = (char*)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
assert(map_shm != MAP_FAILED);
|
||||
|
||||
|
||||
struct xkb_keymap *xkb_keymap = xkb_keymap_new_from_string(seat->xkb_context, map_shm,
|
||||
XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||
munmap(map_shm, size);
|
||||
close(fd);
|
||||
|
||||
|
||||
struct xkb_state *xkb_state = xkb_state_new(xkb_keymap);
|
||||
xkb_keymap_unref(seat->xkb_keymap);
|
||||
xkb_state_unref(seat->xkb_state);
|
||||
@ -680,7 +680,7 @@ fprintf(stderr, "key %s: sym: %-12s(%d) code:%u fl_win=%p, ", action, buf, sym,
|
||||
//fprintf(stderr, "xkb_compose_status=%d ctxt=%p state=%p l=%d[%s]\n", status, seat->xkb_context, seat->xkb_compose_state, Fl::e_length, buf);
|
||||
}
|
||||
// end of part used only without text-input-unstable-v3
|
||||
|
||||
|
||||
wld_event_time = time;
|
||||
int event = (state == WL_KEYBOARD_KEY_STATE_PRESSED ? FL_KEYDOWN : FL_KEYUP);
|
||||
// Send event to focus-containing top window as defined by FLTK,
|
||||
@ -739,7 +739,7 @@ static const struct wl_keyboard_listener wl_keyboard_listener = {
|
||||
.repeat_info = wl_keyboard_repeat_info,
|
||||
};
|
||||
|
||||
|
||||
|
||||
void text_input_enter(void *data, struct zwp_text_input_v3 *zwp_text_input_v3,
|
||||
struct wl_surface *surface) {
|
||||
//puts("text_input_enter");
|
||||
@ -823,7 +823,7 @@ static void seat_capabilities(void *data, struct wl_seat *wl_seat, uint32_t capa
|
||||
wl_pointer_release(seat->wl_pointer);
|
||||
seat->wl_pointer = NULL;
|
||||
}
|
||||
|
||||
|
||||
bool have_keyboard = capabilities & WL_SEAT_CAPABILITY_KEYBOARD;
|
||||
if (have_keyboard && seat->wl_keyboard == NULL) {
|
||||
seat->wl_keyboard = wl_seat_get_keyboard(wl_seat);
|
||||
@ -932,16 +932,16 @@ static void registry_handle_global(void *user_data, struct wl_registry *wl_regis
|
||||
}
|
||||
scr_driver->wl_compositor = (struct wl_compositor*)wl_registry_bind(wl_registry,
|
||||
id, &wl_compositor_interface, 4);
|
||||
|
||||
|
||||
} else if (strcmp(interface, "wl_subcompositor") == 0) {
|
||||
scr_driver->wl_subcompositor = (struct wl_subcompositor*)wl_registry_bind(wl_registry,
|
||||
id, &wl_subcompositor_interface, 1);
|
||||
|
||||
id, &wl_subcompositor_interface, 1);
|
||||
|
||||
} else if (strcmp(interface, "wl_shm") == 0) {
|
||||
scr_driver->wl_shm = (struct wl_shm*)wl_registry_bind(wl_registry,
|
||||
id, &wl_shm_interface, 1);
|
||||
wl_shm_add_listener(scr_driver->wl_shm, &shm_listener, NULL);
|
||||
|
||||
|
||||
} else if (strcmp(interface, "wl_seat") == 0) {
|
||||
if (version < 3) {
|
||||
Fl::fatal("%s version 3 required but only version %i is available\n", interface, version);
|
||||
@ -965,7 +965,7 @@ static void registry_handle_global(void *user_data, struct wl_registry *wl_regis
|
||||
scr_driver->seat->data_device = wl_data_device_manager_get_data_device(scr_driver->seat->data_device_manager, scr_driver->seat->wl_seat);
|
||||
wl_data_device_add_listener(scr_driver->seat->data_device, Fl_Wayland_Screen_Driver::p_data_device_listener, NULL);
|
||||
}
|
||||
|
||||
|
||||
} else if (strcmp(interface, wl_data_device_manager_interface.name) == 0) {
|
||||
if (!scr_driver->seat) scr_driver->seat = (struct seat*)calloc(1, sizeof(struct seat));
|
||||
scr_driver->seat->data_device_manager = (struct wl_data_device_manager*)wl_registry_bind(wl_registry, id, &wl_data_device_manager_interface, 3);
|
||||
@ -974,7 +974,7 @@ static void registry_handle_global(void *user_data, struct wl_registry *wl_regis
|
||||
wl_data_device_add_listener(scr_driver->seat->data_device, Fl_Wayland_Screen_Driver::p_data_device_listener, NULL);
|
||||
}
|
||||
//fprintf(stderr, "registry_handle_global: %s\n", interface);
|
||||
|
||||
|
||||
} else if (strcmp(interface, "wl_output") == 0) {
|
||||
if (version < 2) {
|
||||
Fl::fatal("%s version 3 required but only version %i is available\n", interface, version);
|
||||
@ -990,7 +990,7 @@ static void registry_handle_global(void *user_data, struct wl_registry *wl_regis
|
||||
wl_list_insert(&(scr_driver->outputs), &output->link);
|
||||
scr_driver->screen_count( wl_list_length(&(scr_driver->outputs)) );
|
||||
//fprintf(stderr, "wl_output: id=%d wl_output=%p screen_count()=%d\n", id, output->wl_output, Fl::screen_count());
|
||||
|
||||
|
||||
} else if (strcmp(interface, xdg_wm_base_interface.name) == 0) {
|
||||
//fprintf(stderr, "registry_handle_global interface=%s\n", interface);
|
||||
scr_driver->xdg_wm_base = (struct xdg_wm_base *)wl_registry_bind(wl_registry, id, &xdg_wm_base_interface, 1);
|
||||
@ -1061,7 +1061,7 @@ Fl_Wayland_Screen_Driver::Fl_Wayland_Screen_Driver() : Fl_Screen_Driver() {
|
||||
|
||||
void Fl_Wayland_Screen_Driver::open_display_platform() {
|
||||
struct wl_registry *wl_registry;
|
||||
|
||||
|
||||
static bool beenHereDoneThat = false;
|
||||
if (beenHereDoneThat)
|
||||
return;
|
||||
|
@ -388,7 +388,7 @@ void Fl_Wayland_Window_Driver::make_current() {
|
||||
fl_alert(err_message);
|
||||
Fl::fatal(err_message);
|
||||
}
|
||||
|
||||
|
||||
struct wld_window *window = fl_xid(pWindow);
|
||||
float scale = Fl::screen_scale(pWindow->screen_num()) * window->scale;
|
||||
if (window && window->buffer) {
|
||||
@ -444,7 +444,7 @@ void Fl_Wayland_Window_Driver::flush() {
|
||||
}
|
||||
struct wld_window *window = fl_xid(pWindow);
|
||||
if (!window || !window->configured_width) return;
|
||||
|
||||
|
||||
Fl_X *i = Fl_X::i(pWindow);
|
||||
Fl_Region r = i->region;
|
||||
float f = Fl::screen_scale(pWindow->screen_num());
|
||||
@ -466,7 +466,7 @@ void Fl_Wayland_Window_Driver::flush() {
|
||||
Fl_Wayland_Window_Driver::in_flush = true;
|
||||
Fl_Window_Driver::flush();
|
||||
Fl_Wayland_Window_Driver::in_flush = false;
|
||||
|
||||
|
||||
wl_surface_frame(window->wl_surface);
|
||||
Fl_Wayland_Graphics_Driver::buffer_commit(window);
|
||||
}
|
||||
@ -769,7 +769,7 @@ static void handle_configure(struct libdecor_frame *frame,
|
||||
float f = Fl::screen_scale(window->fl_win->screen_num());
|
||||
|
||||
if (!window->xdg_surface) window->xdg_surface = libdecor_frame_get_xdg_surface(frame);
|
||||
|
||||
|
||||
if (window->fl_win->fullscreen_active()) {
|
||||
libdecor_frame_set_fullscreen(window->frame, NULL);
|
||||
} else if (driver->show_iconic()) {
|
||||
@ -795,17 +795,17 @@ static void handle_configure(struct libdecor_frame *frame,
|
||||
}
|
||||
} else { width = height = 0; }
|
||||
}
|
||||
|
||||
|
||||
if (width == 0) {
|
||||
width = window->floating_width;
|
||||
height = window->floating_height;
|
||||
//fprintf(stderr,"handle_configure: using floating %dx%d\n",width,height);
|
||||
}
|
||||
|
||||
|
||||
driver->in_handle_configure = true;
|
||||
window->fl_win->resize(0, 0, ceil(width / f), ceil(height / f));
|
||||
driver->in_handle_configure = false;
|
||||
|
||||
|
||||
if (ceil(width / f) != window->configured_width || ceil(height / f) != window->configured_height) {
|
||||
if (window->buffer) {
|
||||
Fl_Wayland_Graphics_Driver::buffer_release(window);
|
||||
@ -899,7 +899,7 @@ static void xdg_surface_configure(void *data, struct xdg_surface *xdg_surface, u
|
||||
struct wld_window *window = (struct wld_window*)data;
|
||||
xdg_surface_ack_configure(xdg_surface, serial);
|
||||
//fprintf(stderr, "xdg_surface_configure: surface=%p\n", window->wl_surface);
|
||||
|
||||
|
||||
if (window->fl_win->w() != window->configured_width || window->fl_win->h() != window->configured_height) {
|
||||
if (window->buffer) {
|
||||
Fl_Wayland_Graphics_Driver::buffer_release(window);
|
||||
@ -1034,7 +1034,7 @@ Fl_X *Fl_Wayland_Window_Driver::makeWindow()
|
||||
struct wld_window *new_window;
|
||||
Fl_Wayland_Screen_Driver::output *output;
|
||||
wait_for_expose_value = 1;
|
||||
|
||||
|
||||
if (pWindow->parent() && !pWindow->window()->shown()) return NULL;
|
||||
|
||||
new_window = (struct wld_window *)calloc(1, sizeof *new_window);
|
||||
@ -1049,7 +1049,7 @@ Fl_X *Fl_Wayland_Window_Driver::makeWindow()
|
||||
new_window->wl_surface = wl_compositor_create_surface(scr_driver->wl_compositor);
|
||||
//Fl::warning("makeWindow:%p wayland-scale=%d user-scale=%.2f\n", pWindow, new_window->scale, Fl::screen_scale(0));
|
||||
wl_surface_add_listener(new_window->wl_surface, &surface_listener, new_window);
|
||||
|
||||
|
||||
if (pWindow->user_data() == &Fl_Screen_Driver::transient_scale_display && Fl::first_window()) {
|
||||
// put transient scale win at center of top window by making it a child of top
|
||||
int center_x, center_y;
|
||||
@ -1059,7 +1059,7 @@ Fl_X *Fl_Wayland_Window_Driver::makeWindow()
|
||||
pWindow->position(center_x - pWindow->w()/2 , center_y - pWindow->h()/2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (pWindow->menu_window() || pWindow->tooltip_window()) { // a menu window or tooltip
|
||||
new_window->kind = POPUP;
|
||||
new_window->xdg_surface = xdg_wm_base_get_xdg_surface(scr_driver->xdg_wm_base, new_window->wl_surface);
|
||||
@ -1112,7 +1112,7 @@ Fl_X *Fl_Wayland_Window_Driver::makeWindow()
|
||||
float f = Fl::screen_scale(pWindow->screen_num());
|
||||
new_window->floating_width = pWindow->w() * f;
|
||||
new_window->floating_height = pWindow->h() * f;
|
||||
|
||||
|
||||
} else if (pWindow->parent()) { // for subwindows (GL or non-GL)
|
||||
new_window->kind = SUBWINDOW;
|
||||
struct wld_window *parent = fl_xid(pWindow->window());
|
||||
@ -1140,7 +1140,7 @@ Fl_X *Fl_Wayland_Window_Driver::makeWindow()
|
||||
wl_surface_commit(new_window->wl_surface);
|
||||
pWindow->border(0);
|
||||
}
|
||||
|
||||
|
||||
Fl_Window *old_first = Fl::first_window();
|
||||
Window first_xid = (old_first ? fl_xid(old_first) : NULL);
|
||||
Fl_X *xp = new Fl_X;
|
||||
@ -1159,7 +1159,7 @@ Fl_X *Fl_Wayland_Window_Driver::makeWindow()
|
||||
xp->next = NULL;
|
||||
Fl_X::first = xp;
|
||||
}
|
||||
|
||||
|
||||
if (pWindow->modal() || pWindow->non_modal()) {
|
||||
if (pWindow->modal()) Fl::modal_ = pWindow;
|
||||
if (new_window->kind == DECORATED && first_xid && first_xid->kind == DECORATED) {
|
||||
@ -1170,14 +1170,14 @@ Fl_X *Fl_Wayland_Window_Driver::makeWindow()
|
||||
top_dr->xdg_toplevel());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
size_range();
|
||||
pWindow->set_visible();
|
||||
int old_event = Fl::e_number;
|
||||
pWindow->handle(Fl::e_number = FL_SHOW); // get child windows to appear
|
||||
Fl::e_number = old_event;
|
||||
pWindow->redraw();
|
||||
|
||||
|
||||
return xp;
|
||||
}
|
||||
|
||||
@ -1462,7 +1462,7 @@ void Fl_Wayland_Window_Driver::resize(int X, int Y, int W, int H) {
|
||||
x(0); y(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (shown()) {
|
||||
struct wld_window *fl_win = fl_xid(pWindow);
|
||||
float f = Fl::screen_scale(pWindow->screen_num());
|
||||
@ -1521,7 +1521,7 @@ void Fl_Wayland_Window_Driver::reposition_menu_window(int x, int y) {
|
||||
y_offset = y-1;
|
||||
y = 1;
|
||||
}
|
||||
|
||||
|
||||
//printf("should move menuwindow to %d y_offset=%d y=%d\n", true_y, y_offset, pWindow->y());
|
||||
struct xdg_popup *old_popup = xid_menu->xdg_popup;
|
||||
struct xdg_surface *old_xdg = xid_menu->xdg_surface;
|
||||
|
@ -144,7 +144,7 @@ static void data_source_handle_action(void *data, struct wl_data_source *source,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void data_source_handle_dnd_drop_performed(void *data, struct wl_data_source *source) {
|
||||
//printf("Drop performed\n");
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <FL/gl.h>
|
||||
|
||||
/* Implementation note about OpenGL drawing on the Wayland platform
|
||||
|
||||
|
||||
After eglCreateWindowSurface() with attributes {EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER, EGL_NONE},
|
||||
eglQueryContext() reports that EGL_RENDER_BUFFER equals EGL_BACK_BUFFER.
|
||||
This experiment suggests that the platform only supports double-buffer drawing.
|
||||
|
@ -34,7 +34,7 @@ static int table_size;
|
||||
\param name Name of the font to assign. The string pointer is simply stored,
|
||||
the string is not copied, so the string must be in static memory. The exact name to be used
|
||||
depends on the platform :
|
||||
|
||||
|
||||
\li Windows, X11, Xft: use the family name prefixed by one character to indicate the desired font variant.
|
||||
Characters <tt>' ', 'I', 'B', 'P' </tt>denote plain, italic, bold, and bold-italic variants, respectively. For example,
|
||||
string \c "IGabriola" is to be used to denote the <tt>"Gabriola italic"</tt> font. The \c "Oblique" suffix,
|
||||
|
Loading…
Reference in New Issue
Block a user