[digesting_libdecor] move libdecor_frame_gtk fields to libdecor_frame, eliminate 'gtk' frame and replace pass-throughts with regular frames

main
Allen Webster 2026-02-26 18:06:56 -08:00
parent babb2ccb59
commit 785b014580
2 changed files with 639 additions and 744 deletions

File diff suppressed because it is too large Load Diff

View File

@ -122,7 +122,60 @@ struct libdecor_limits {
int max_height; int max_height;
}; };
enum header_element {
HEADER_NONE,
HEADER_FULL, /* entire header bar */
HEADER_TITLE, /* label */
HEADER_MIN,
HEADER_MAX,
HEADER_CLOSE,
};
enum titlebar_gesture_state {
TITLEBAR_GESTURE_STATE_INIT,
TITLEBAR_GESTURE_STATE_BUTTON_PRESSED,
TITLEBAR_GESTURE_STATE_CONSUMED,
TITLEBAR_GESTURE_STATE_DISCARDED,
};
struct header_element_data {
const char *name;
enum header_element type;
/* pointer to button or NULL if not found*/
GtkWidget *widget;
GtkStateFlags state;
};
enum decoration_type {
DECORATION_TYPE_NONE,
DECORATION_TYPE_ALL,
DECORATION_TYPE_TITLE_ONLY
};
enum component {
NONE = 0,
SHADOW,
HEADER,
};
struct border_component {
enum component type;
struct wl_surface *wl_surface;
struct wl_subsurface *wl_subsurface;
struct buffer *buffer;
bool opaque;
struct wl_list output_list;
int scale;
struct wl_list child_components; /* border_component::link */
struct wl_list link; /* border_component::child_components */
};
struct libdecor_frame { struct libdecor_frame {
//struct libdecor_frame;
struct wl_list frame_link;
//struct libdecor_frame_private;
int ref_count; int ref_count;
struct wl_surface *wl_surface; struct wl_surface *wl_surface;
@ -144,15 +197,15 @@ struct libdecor_frame {
struct libdecor_configuration *pending_configuration; struct libdecor_configuration *pending_configuration;
int content_width; int frame_content_width;
int content_height; int frame_content_height;
enum libdecor_window_state window_state; enum libdecor_window_state frame_window_state;
bool has_decoration_mode; bool has_decoration_mode;
enum zxdg_toplevel_decoration_v1_mode decoration_mode; enum zxdg_toplevel_decoration_v1_mode decoration_mode;
enum libdecor_capabilities capabilities; enum libdecor_capabilities frame_capabilities;
enum libdecor_wm_capabilities wm_capabilities; enum libdecor_wm_capabilities wm_capabilities;
@ -161,7 +214,46 @@ struct libdecor_frame {
bool visible; bool visible;
struct wl_list link; //struct libdecor_frame_gtk;
int gtk_content_width;
int gtk_content_height;
enum libdecor_window_state gtk_window_state;
enum decoration_type decoration_type;
char *title;
enum libdecor_capabilities gtk_capabilities;
struct border_component *active;
struct border_component *touch_active;
struct border_component *focus;
struct border_component *grab;
bool shadow_showing;
struct border_component shadow;
GtkWidget *window; /* offscreen window for rendering */
GtkWidget *header; /* header bar with widgets */
struct border_component headerbar;
struct header_element_data hdr_focus;
/* store pre-processed shadow tile */
cairo_surface_t *shadow_blur;
struct wl_list gtk_link;
struct {
enum titlebar_gesture_state state;
int button_pressed_count;
uint32_t first_pressed_button;
uint32_t first_pressed_time;
double pressed_x;
double pressed_y;
uint32_t pressed_serial;
} titlebar_gesture;
}; };
// #include "libdecor.c" // #include "libdecor.c"
@ -206,42 +298,6 @@ static const char *cursor_names[] = {
"bottom_right_corner" "bottom_right_corner"
}; };
enum header_element {
HEADER_NONE,
HEADER_FULL, /* entire header bar */
HEADER_TITLE, /* label */
HEADER_MIN,
HEADER_MAX,
HEADER_CLOSE,
};
enum titlebar_gesture_state {
TITLEBAR_GESTURE_STATE_INIT,
TITLEBAR_GESTURE_STATE_BUTTON_PRESSED,
TITLEBAR_GESTURE_STATE_CONSUMED,
TITLEBAR_GESTURE_STATE_DISCARDED,
};
struct header_element_data {
const char *name;
enum header_element type;
/* pointer to button or NULL if not found*/
GtkWidget *widget;
GtkStateFlags state;
};
enum decoration_type {
DECORATION_TYPE_NONE,
DECORATION_TYPE_ALL,
DECORATION_TYPE_TITLE_ONLY
};
enum component {
NONE = 0,
SHADOW,
HEADER,
};
struct seat { struct seat {
char *name; char *name;
@ -295,19 +351,6 @@ struct buffer {
int buffer_height; int buffer_height;
}; };
struct border_component {
enum component type;
struct wl_surface *wl_surface;
struct wl_subsurface *wl_subsurface;
struct buffer *buffer;
bool opaque;
struct wl_list output_list;
int scale;
struct wl_list child_components; /* border_component::link */
struct wl_list link; /* border_component::child_components */
};
struct surface_output { struct surface_output {
struct output *output; struct output *output;
struct wl_list link; struct wl_list link;
@ -318,50 +361,6 @@ struct cursor_output {
struct wl_list link; struct wl_list link;
}; };
struct libdecor_frame_gtk {
struct libdecor_frame frame;
int content_width;
int content_height;
enum libdecor_window_state window_state;
enum decoration_type decoration_type;
char *title;
enum libdecor_capabilities capabilities;
struct border_component *active;
struct border_component *touch_active;
struct border_component *focus;
struct border_component *grab;
bool shadow_showing;
struct border_component shadow;
GtkWidget *window; /* offscreen window for rendering */
GtkWidget *header; /* header bar with widgets */
struct border_component headerbar;
struct header_element_data hdr_focus;
/* store pre-processed shadow tile */
cairo_surface_t *shadow_blur;
struct wl_list link;
struct {
enum titlebar_gesture_state state;
int button_pressed_count;
uint32_t first_pressed_button;
uint32_t first_pressed_time;
double pressed_x;
double pressed_y;
uint32_t pressed_serial;
} titlebar_gesture;
};
enum titlebar_gesture { enum titlebar_gesture {
TITLEBAR_GESTURE_DOUBLE_CLICK, TITLEBAR_GESTURE_DOUBLE_CLICK,
TITLEBAR_GESTURE_MIDDLE_CLICK, TITLEBAR_GESTURE_MIDDLE_CLICK,