diff options
Diffstat (limited to 'src/pgtkterm.c')
-rw-r--r-- | src/pgtkterm.c | 91 |
1 files changed, 45 insertions, 46 deletions
diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 9f82b9d972a..1ec6bfcda4e 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -3150,11 +3150,15 @@ pgtk_scroll_run (struct window *w, struct run *run) /* Icons. */ -/* Make the x-window of frame F use the gnu icon bitmap. */ - static bool pgtk_bitmap_icon (struct frame *f, Lisp_Object file) { + /* This code has never worked anyway for the reason that Wayland + uses icons set within desktop files, and has been disabled + because leaving it intact would require image.c to retain a + reference to a GdkPixbuf (which are no longer used) within new + bitmaps. */ +#if 0 ptrdiff_t bitmap_id; if (FRAME_GTK_WIDGET (f) == 0) @@ -3210,12 +3214,8 @@ pgtk_bitmap_icon (struct frame *f, Lisp_Object file) bitmap_id = FRAME_DISPLAY_INFO (f)->icon_bitmap_id; } - if (FRAME_DISPLAY_INFO (f)->bitmaps[bitmap_id - 1].img != NULL) - gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - FRAME_DISPLAY_INFO (f)->bitmaps[bitmap_id - 1].img); - f->output_data.pgtk->icon_bitmap = bitmap_id; - +#endif /* 0 */ return false; } @@ -3471,9 +3471,7 @@ pgtk_define_fringe_bitmap (int which, unsigned short *bits, int h, int wd) i = max_fringe_bmp; max_fringe_bmp = which + 20; fringe_bmp - = (cairo_pattern_t **) xrealloc (fringe_bmp, - max_fringe_bmp * - sizeof (cairo_pattern_t *)); + = xrealloc (fringe_bmp, max_fringe_bmp * sizeof (cairo_pattern_t *)); while (i < max_fringe_bmp) fringe_bmp[i++] = 0; } @@ -3769,7 +3767,8 @@ pgtk_flash (struct frame *f) cairo_rectangle (cr, flash_left, (height - flash_height - - FRAME_INTERNAL_BORDER_WIDTH (f)), + - FRAME_INTERNAL_BORDER_WIDTH (f) + - FRAME_BOTTOM_MARGIN_HEIGHT (f)), width, flash_height); cairo_fill (cr); } @@ -4950,36 +4949,38 @@ pgtk_clear_under_internal_border (struct frame *f) int width = FRAME_PIXEL_WIDTH (f); int height = FRAME_PIXEL_HEIGHT (f); int margin = FRAME_TOP_MARGIN_HEIGHT (f); - int face_id = - (FRAME_PARENT_FRAME (f) - ? (!NILP (Vface_remapping_alist) - ? lookup_basic_face (NULL, f, CHILD_FRAME_BORDER_FACE_ID) - : CHILD_FRAME_BORDER_FACE_ID) - : (!NILP (Vface_remapping_alist) - ? lookup_basic_face (NULL, f, INTERNAL_BORDER_FACE_ID) - : INTERNAL_BORDER_FACE_ID)); + int bottom_margin = FRAME_BOTTOM_MARGIN_HEIGHT (f); + int face_id = (FRAME_PARENT_FRAME (f) + ? (!NILP (Vface_remapping_alist) + ? lookup_basic_face (NULL, f, + CHILD_FRAME_BORDER_FACE_ID) + : CHILD_FRAME_BORDER_FACE_ID) + : (!NILP (Vface_remapping_alist) + ? lookup_basic_face (NULL, f, + INTERNAL_BORDER_FACE_ID) + : INTERNAL_BORDER_FACE_ID)); struct face *face = FACE_FROM_ID_OR_NULL (f, face_id); block_input (); 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 + - bottom_margin + - 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 - bottom_margin - border, + width, border); } unblock_input (); @@ -5824,8 +5825,8 @@ note_mouse_movement (struct frame *frame, /* Has the mouse moved off the glyph it was on at the last sighting? */ r = &dpyinfo->last_mouse_glyph; if (frame != dpyinfo->last_mouse_glyph_frame - || event->x < r->x || event->x >= r->x + r->width - || event->y < r->y || event->y >= r->y + r->height) + || event->x < r->x || event->x >= r->x + (int) r->width + || event->y < r->y || event->y >= r->y + (int) r->height) { frame->mouse_moved = true; dpyinfo->last_mouse_scroll_bar = NULL; @@ -5891,7 +5892,7 @@ motion_notify_event (GtkWidget *widget, GdkEvent *event, { static Lisp_Object last_mouse_window; Lisp_Object window = window_from_coordinates - (f, event->motion.x, event->motion.y, 0, false, false); + (f, event->motion.x, event->motion.y, 0, false, false, false); /* A window will be autoselected only when it is not selected now and the last mouse movement event was @@ -6044,7 +6045,7 @@ button_event (GtkWidget *widget, GdkEvent *event, int x = event->button.x; int y = event->button.y; - window = window_from_coordinates (f, x, y, 0, true, true); + window = window_from_coordinates (f, x, y, 0, true, true, true); tab_bar_p = EQ (window, f->tab_bar_window); if (tab_bar_p) @@ -6685,12 +6686,12 @@ pgtk_display_x_warning (GdkDisplay *display) gtk_window_set_title (window, "Warning"); gtk_window_set_screen (window, screen); - label = gtk_label_new ("You are trying to run Emacs configured with" - " the \"pure-GTK\" interface under the X Window" - " System. That configuration is unsupported and" - " will lead to sporadic crashes during transfer of" - " large selection data. It will also lead to" - " various problems with keyboard input."); + label = gtk_label_new ("You are trying to run Emacs configured with\n" + " the \"pure-GTK\" interface under the X Window\n" + " System. That configuration is unsupported and\n" + " will lead to sporadic crashes during transfer of\n" + " large selection data. It will also lead to\n" + " various problems with keyboard input.\n"); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_container_add (GTK_CONTAINER (content_area), label); gtk_widget_show (label); @@ -6845,8 +6846,7 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name) Lisp_Object system_name = Fsystem_name (); ptrdiff_t nbytes; - if (INT_ADD_WRAPV (SBYTES (Vinvocation_name), SBYTES (system_name) + 2, - &nbytes)) + if (ckd_add (&nbytes, SBYTES (Vinvocation_name), SBYTES (system_name) + 2)) memory_full (SIZE_MAX); dpyinfo->x_id = ++x_display_id; dpyinfo->x_id_name = xmalloc (nbytes); @@ -7178,8 +7178,7 @@ If set to a non-float value, there will be no wait at all. */); DEFVAR_LISP ("pgtk-keysym-table", Vpgtk_keysym_table, doc: /* Hash table of character codes indexed by X keysym codes. */); - Vpgtk_keysym_table = make_hash_table (hashtest_eql, 900, DEFAULT_REHASH_SIZE, - DEFAULT_REHASH_THRESHOLD, Qnil, false); + Vpgtk_keysym_table = make_hash_table (&hashtest_eql, 900, Weak_None, false); window_being_scrolled = Qnil; staticpro (&window_being_scrolled); |