Fix detection of tab bar windows on PGTK

* src/dispnew.c (adjust_frame_glyphs_for_window_redisplay):
Adjust commentary.
* src/pgtkfns.c (pgtk_set_doc_edited): Remove unused function.
* src/pgtkterm.c (pgtk_clear_under_internal_border): Clean up X
related code.
* src/pgtkterm.h: Update prototypes.
* src/window.h: Define WIDNOW_TAB_BAR_P on PGTK.  (bug#63472)
This commit is contained in:
Po Lu 2023-05-13 10:27:57 +08:00
parent d9f674aea5
commit fa598571ad
5 changed files with 21 additions and 26 deletions

View file

@ -2212,10 +2212,16 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
w->pixel_left = 0;
w->left_col = 0;
w->pixel_top = FRAME_MENU_BAR_HEIGHT (f)
+ (!NILP (Vtab_bar_position) ? FRAME_TOOL_BAR_HEIGHT (f) : 0);
w->top_line = FRAME_MENU_BAR_LINES (f)
+ (!NILP (Vtab_bar_position) ? FRAME_TOOL_BAR_LINES (f) : 0);
/* Note that tab and tool bar windows appear above the internal
border, as enforced by WINDOW_TOP_EDGE_Y. */
w->pixel_top = (FRAME_MENU_BAR_HEIGHT (f)
+ (!NILP (Vtab_bar_position)
? FRAME_TOOL_BAR_HEIGHT (f) : 0));
w->top_line = (FRAME_MENU_BAR_LINES (f)
+ (!NILP (Vtab_bar_position)
? FRAME_TOOL_BAR_LINES (f) : 0));
w->total_cols = FRAME_TOTAL_COLS (f);
w->pixel_width = (FRAME_PIXEL_WIDTH (f)
- 2 * FRAME_INTERNAL_BORDER_WIDTH (f));

View file

@ -398,13 +398,6 @@ pgtk_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
pgtk_set_name_internal (f, name);
}
void
pgtk_set_doc_edited (void)
{
}
static void
pgtk_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{

View file

@ -4954,22 +4954,19 @@ pgtk_clear_under_internal_border (struct frame *f)
if (face)
{
#define x_fill_rectangle(f, gc, x, y, w, h) \
fill_background_by_face (f, face, x, y, w, h)
x_fill_rectangle (f, gc, 0, margin, width, border);
x_fill_rectangle (f, gc, 0, 0, border, height);
x_fill_rectangle (f, gc, width - border, 0, border, height);
x_fill_rectangle (f, gc, 0, height - border, width, border);
#undef x_fill_rectangle
fill_background_by_face (f, face, 0, margin, width, border);
fill_background_by_face (f, face, 0, 0, border, height);
fill_background_by_face (f, face, width - border, 0, border,
height);
fill_background_by_face (f, face, 0, height - border, width,
border);
}
else
{
#define x_clear_area(f, x, y, w, h) pgtk_clear_area (f, x, y, w, h)
x_clear_area (f, 0, 0, border, height);
x_clear_area (f, 0, margin, width, border);
x_clear_area (f, width - border, 0, border, height);
x_clear_area (f, 0, height - border, width, border);
#undef x_clear_area
pgtk_clear_area (f, 0, 0, border, height);
pgtk_clear_area (f, 0, margin, width, border);
pgtk_clear_area (f, width - border, 0, border, height);
pgtk_clear_area (f, 0, height - border, width, border);
}
unblock_input ();

View file

@ -553,7 +553,6 @@ extern void pgtk_clear_frame (struct frame *);
extern char *pgtk_xlfd_to_fontname (const char *);
/* Implemented in pgtkfns.c. */
extern void pgtk_set_doc_edited (void);
extern const char *pgtk_get_defaults_value (const char *);
extern const char *pgtk_get_string_resource (XrmDatabase, const char *, const char *);
extern void pgtk_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);

View file

@ -750,7 +750,7 @@ wset_next_buffers (struct window *w, Lisp_Object val)
#endif
/* True if W is a tab bar window. */
#if defined (HAVE_WINDOW_SYSTEM) && !defined (HAVE_PGTK)
#if defined (HAVE_WINDOW_SYSTEM)
# define WINDOW_TAB_BAR_P(W) \
(WINDOWP (WINDOW_XFRAME (W)->tab_bar_window) \
&& (W) == XWINDOW (WINDOW_XFRAME (W)->tab_bar_window))