Fix for issue #441: Some minor regressions with borderless+fullscreen (Wayland).

This commit is contained in:
ManoloFLTK 2022-05-10 16:52:46 +02:00
parent ad27da578a
commit b6e0122926
2 changed files with 11 additions and 4 deletions

View File

@ -670,7 +670,7 @@ libdecor_plugin_gtk_frame_free(struct libdecor_plugin *plugin,
(struct libdecor_frame_gtk *) frame; (struct libdecor_frame_gtk *) frame;
#if APPLY_FLTK_CHANGES #if APPLY_FLTK_CHANGES
if (!frame_gtk->header) return; /* happens with SSD */ if (!frame_gtk->header || !GTK_IS_WIDGET(frame_gtk->header)) return; /* happens with SSD (or not)*/
#endif #endif
gtk_widget_destroy(frame_gtk->header); gtk_widget_destroy(frame_gtk->header);
#if APPLY_FLTK_CHANGES #if APPLY_FLTK_CHANGES
@ -1783,7 +1783,11 @@ libdecor_plugin_gtk_frame_get_border_size(struct libdecor_plugin *plugin,
GtkWidget *header = ((struct libdecor_frame_gtk *)frame)->header; GtkWidget *header = ((struct libdecor_frame_gtk *)frame)->header;
enum decoration_type type = window_state_to_decoration_type(window_state); enum decoration_type type = window_state_to_decoration_type(window_state);
if (header && (type != DECORATION_TYPE_NONE)) if (header && (type != DECORATION_TYPE_NONE)
#if APPLY_FLTK_CHANGES
&& GTK_IS_WIDGET(header)
#endif
)
*top = gtk_widget_get_allocated_height(header); *top = gtk_widget_get_allocated_height(header);
else else
*top = 0; *top = 0;
@ -2298,7 +2302,7 @@ pointer_button(void *data,
state == WL_POINTER_BUTTON_STATE_PRESSED && state == WL_POINTER_BUTTON_STATE_PRESSED &&
seat->pointer_focus == frame_gtk->headerbar.wl_surface) { seat->pointer_focus == frame_gtk->headerbar.wl_surface) {
#if APPLY_FLTK_CHANGES #if APPLY_FLTK_CHANGES
const int title_height = frame_gtk->header ? gtk_widget_get_allocated_height(frame_gtk->header) : 0; const int title_height = frame_gtk->header && GTK_IS_WIDGET(frame_gtk->header) ? gtk_widget_get_allocated_height(frame_gtk->header) : 0;
#else #else
const int title_height = gtk_widget_get_allocated_height(frame_gtk->header); const int title_height = gtk_widget_get_allocated_height(frame_gtk->header);
#endif #endif

View File

@ -876,6 +876,7 @@ static void xdg_surface_configure(void *data, struct xdg_surface *xdg_surface, u
} }
window->configured_width = window->fl_win->w(); window->configured_width = window->fl_win->w();
window->configured_height = window->fl_win->h(); window->configured_height = window->fl_win->h();
Fl::handle(FL_FOCUS, window->fl_win);
window->fl_win->redraw(); window->fl_win->redraw();
Fl_Window_Driver::driver(window->fl_win)->flush(); Fl_Window_Driver::driver(window->fl_win)->flush();
} }
@ -1303,10 +1304,12 @@ void Fl_Wayland_Window_Driver::update_scale()
void Fl_Wayland_Window_Driver::use_border() { void Fl_Wayland_Window_Driver::use_border() {
if (!shown() || pWindow->parent()) return; if (!shown() || pWindow->parent()) return;
struct libdecor_frame *frame = fl_xid(pWindow)->frame; struct libdecor_frame *frame = fl_xid(pWindow)->frame;
if (frame && Fl_Wayland_Screen_Driver::compositor != Fl_Wayland_Screen_Driver::KDE) { if (frame && Fl_Wayland_Screen_Driver::compositor != Fl_Wayland_Screen_Driver::KDE &&
&& fl_xid(pWindow)->xdg_surface) {
libdecor_frame_set_visibility(frame, pWindow->border()); libdecor_frame_set_visibility(frame, pWindow->border());
pWindow->redraw(); pWindow->redraw();
} else { } else {
pWindow->wait_for_expose(); // useful for border(0) just after show()
Fl_Window_Driver::use_border(); Fl_Window_Driver::use_border();
} }
} }