From: Yuuki Harano Date: Tue, 23 Nov 2021 15:32:57 +0000 (+0900) Subject: Remove PGTK_DEBUG stuff X-Git-Tag: emacs-29.0.90~3650 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=901938109f7b5574e97e787bee10441086680de8;p=emacs.git Remove PGTK_DEBUG stuff * src/gtkutil.c: (xg_create_frame_widgets): (xg_create_frame_outer_widgets): (x_wm_set_size_hint): (xg_set_toolkit_scroll_bar_thumb): * src/pgtkfns.c (x_set_background_color): (pgtk_set_name): (x_explicitly_set_name): (pgtk_implicitly_set_name): (x_set_title): (Fx_create_frame): (Fpgtk_set_mouse_absolute_pixel_position): (pgtk_log): (pgtk_backtrace): * src/pgtkselect.c (get_func): (clear_func): (pgtk_selection_lost): (Fpgtk_own_selection_internal): (Fpgtk_disown_selection_internal): (Fpgtk_selection_exists_p): (Fpgtk_selection_owner_p): (nxatoms_of_pgtkselect): (syms_of_pgtkselect): * src/pgtkterm.c (flip_cr_context): (get_keysym_name): (frame_set_mouse_pixel_position): (x_free_frame_resources): (x_destroy_window): (x_set_offset): (pgtk_set_window_size): (pgtk_iconify_frame): (pgtk_make_frame_visible): (pgtk_make_frame_invisible): (pgtk_new_font): (x_display_pixel_height): (x_display_pixel_width): (x_set_no_focus_on_map): (x_set_no_accept_focus): (x_set_z_group): (x_set_cursor_gc): (x_set_glyph_string_gc): (x_set_glyph_string_clipping): (x_draw_glyph_string_background): (pgtk_draw_glyph_string): (pgtk_after_update_window_line): (pgtk_clear_frame_area): (pgtk_draw_window_cursor): (pgtk_copy_bits): (pgtk_cr_draw_image): (pgtk_draw_fringe_bitmap): (pgtk_redraw_scroll_bars): (pgtk_clear_frame): (pgtk_read_socket): (pgtk_select): (xg_scroll_callback): (xg_end_scroll_callback): (pgtk_set_vertical_scroll_bar): (set_fullscreen_state): (pgtk_fullscreen_hook): (pgtk_handle_event): (pgtk_fill_rectangle): (pgtk_clear_under_internal_border): (print_widget_tree_recursive): (print_widget_tree): (pgtk_handle_draw): (size_allocate): (key_press_event): (key_release_event): (map_event): (delete_event): (enter_notify_event): (leave_notify_event): (focus_in_event): (focus_out_event): (motion_notify_event): (button_event): (scroll_event): (drag_data_received): (pgtk_xlfd_to_fontname): (pgtk_defined_color): (pgtk_parse_color): (pgtk_query_colors): (pgtk_query_color): (pgtk_clear_area): (pgtk_cr_update_surface_desired_size): (pgtk_begin_cr_clip): (pgtk_end_cr_clip): (pgtk_set_cr_source_with_gc_foreground): (pgtk_set_cr_source_with_gc_background): (pgtk_set_cr_source_with_color): (pgtk_cr_draw_frame): (pgtk_cr_destroy_frame_context): * src/pgtkterm.h: --- diff --git a/src/gtkutil.c b/src/gtkutil.c index cb334747113..d4823f813bc 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -51,9 +51,6 @@ typedef struct pgtk_output xp_output; #include "termhooks.h" #include "keyboard.h" #include "coding.h" -#ifndef PGTK_TRACE -#define PGTK_TRACE(fmt, ...) ((void) 0) -#endif #include @@ -1408,7 +1405,6 @@ xg_create_frame_widgets (struct frame *f) GtkWindowType type = GTK_WINDOW_TOPLEVEL; char *title = 0; - PGTK_TRACE ("xg_create_frame_widgets."); block_input (); #ifndef HAVE_PGTK // gtk_plug not found. @@ -1622,7 +1618,6 @@ xg_create_frame_outer_widgets (struct frame *f) GtkWindowType type = GTK_WINDOW_TOPLEVEL; char *title = 0; - PGTK_TRACE ("xg_create_frame_outer_widgets."); block_input (); wtop = gtk_window_new (type); @@ -1814,7 +1809,6 @@ x_wm_set_size_hint (struct frame *f, long int flags, bool user_position) base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 1) + FRAME_TOOLBAR_WIDTH (f); base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 1) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); - PGTK_TRACE ("base: %dx%d\n", base_width, base_height); size_hints.base_width = base_width; size_hints.base_height = base_height; @@ -4569,8 +4563,6 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); - PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: ----------------------------------"); - PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: %p, %d, %d, %d.", bar, portion, position, whole); if (wscroll && bar->dragging == -1) { GtkAdjustment *adj; @@ -4602,26 +4594,17 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, top = (gdouble) position / whole; shown = (gdouble) portion / whole; } - PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: position=%d, portion=%d, whole=%d", position, portion, whole); - PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: top=%f, shown=%f", top, shown); - PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: shown*range=%f", shown * XG_SB_RANGE); size = clip_to_bounds (1, shown * XG_SB_RANGE, XG_SB_RANGE); - PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: size=%d.", size); - PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: top*range=%f.", top * XG_SB_RANGE); - PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: max-size=%d.", XG_SB_MAX - size); value = clip_to_bounds (XG_SB_MIN, top * XG_SB_RANGE, XG_SB_MAX - size); - PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: value=%d.", value); /* Assume all lines are of equal size. */ new_step = size / max (1, FRAME_LINES (f)); old_size = gtk_adjustment_get_page_size (adj); - PGTK_TRACE("xg_set_toolkit_scroll_bar_thumb: old_size=%d, size=%d", old_size, size); if (old_size != size) { int old_step = gtk_adjustment_get_step_increment (adj); - PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: old_step=%d, new_step=%d", old_step, new_step); if (old_step != new_step) { gtk_adjustment_set_page_size (adj, size); @@ -4632,8 +4615,6 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, } } - PGTK_TRACE ("xg_set_toolkit_scroll_bar_thumb: changed=%d, old=%d, value=%d.", - changed, int_gtk_range_get_value (GTK_RANGE (wscroll)), value); if (changed || int_gtk_range_get_value (GTK_RANGE (wscroll)) != value) { block_input (); diff --git a/src/pgtkfns.c b/src/pgtkfns.c index 3c2ea02831a..339d6dd45ae 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -222,13 +222,11 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) if (FRAME_VISIBLE_P (f)) pgtk_clear_frame (f); - PGTK_TRACE ("x_set_background_color: col.pixel=%08lx.", bg); FRAME_X_OUTPUT (f)->background_color = bg; xg_set_background_color (f, bg); update_face_from_frame_parameter (f, Qbackground_color, arg); - PGTK_TRACE ("visible_p=%d.", FRAME_VISIBLE_P (f)); if (FRAME_VISIBLE_P (f)) SET_FRAME_GARBAGED (f); } @@ -311,8 +309,6 @@ pgtk_set_name_internal (struct frame *f, Lisp_Object name) static void pgtk_set_name (struct frame *f, Lisp_Object name, int explicit) { - PGTK_TRACE ("pgtk_set_name"); - /* Make sure that requests from lisp code override requests from Emacs redisplay code. */ if (explicit) @@ -352,7 +348,6 @@ pgtk_set_name (struct frame *f, Lisp_Object name, int explicit) static void x_explicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { - PGTK_TRACE ("x_explicitly_set_name"); pgtk_set_name (f, arg, true); } @@ -364,7 +359,6 @@ void pgtk_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { - PGTK_TRACE ("x_implicitly_set_name"); pgtk_set_name (f, arg, false); } @@ -375,7 +369,6 @@ pgtk_implicitly_set_name (struct frame *f, Lisp_Object arg, static void x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name) { - PGTK_TRACE ("x_set_title"); /* Don't change the title if it's already NAME. */ if (EQ (name, f->title)) return; @@ -1670,7 +1663,6 @@ This function is an internal primitive--use `make-frame' instead. */ ) block_input (); - PGTK_TRACE ("x_set_parent_frame x: %d, y: %d", f->left_pos, f->top_pos); GtkWidget *fixed = FRAME_GTK_WIDGET (f); GtkWidget *fixed_of_p = FRAME_GTK_WIDGET (p); GtkWidget *whbox_of_f = gtk_widget_get_parent (fixed); @@ -3726,7 +3718,6 @@ The coordinates X and Y are interpreted in pixels relative to a position GdkSeat *seat = gdk_display_get_default_seat (gdpy); GdkDevice *device = gdk_seat_get_pointer (seat); - PGTK_TRACE ("pgtk-set-mouse-absolute-pixel-position:"); gdk_device_warp (device, gscr, XFIXNUM (x), XFIXNUM (y)); /* No effect on wayland. */ return Qnil; @@ -4128,66 +4119,4 @@ eliminated in future versions of Emacs. */); DEFSYM (Qreverse_landscape, "reverse-landscape"); } - -#ifdef PGTK_DEBUG -#include -#include -void -pgtk_log (const char *file, int lineno, const char *fmt, ...) -{ - struct timespec ts; - struct tm tm; - char timestr[32]; - va_list ap; - - clock_gettime (CLOCK_REALTIME, &ts); - - localtime_r (&ts.tv_sec, &tm); - strftime (timestr, sizeof timestr, "%H:%M:%S", &tm); - - fprintf (stderr, "%s.%06ld %.10s:%04d ", timestr, ts.tv_nsec / 1000, file, - lineno); - va_start (ap, fmt); - vfprintf (stderr, fmt, ap); - va_end (ap); - fputc ('\n', stderr); -} - -void -pgtk_backtrace (const char *file, int lineno) -{ - Lisp_Object bt = make_uninit_vector (10); - for (int i = 0; i < 10; i++) - ASET (bt, i, Qnil); - - struct timespec ts; - struct tm tm; - char timestr[32]; - - clock_gettime (CLOCK_REALTIME, &ts); - - localtime_r (&ts.tv_sec, &tm); - strftime (timestr, sizeof timestr, "%H:%M:%S", &tm); - - fprintf (stderr, "%s.%06ld %.10s:%04d ********\n", timestr, - ts.tv_nsec / 1000, file, lineno); - - get_backtrace (bt); - for (int i = 0; i < 10; i++) - { - Lisp_Object stk = AREF (bt, i); - if (!NILP (stk)) - { - Lisp_Object args[2] = { build_string ("%S"), stk }; - Lisp_Object str = Fformat (2, args); - fprintf (stderr, "%s %.10s:%04d %s\n", timestr, file, lineno, - SSDATA (str)); - } - } - - fprintf (stderr, "%s %.10s:%04d ********\n", timestr, file, lineno); -} - -#endif - #endif diff --git a/src/pgtkselect.c b/src/pgtkselect.c index 58a2b0d05e2..77a563dc3f3 100644 --- a/src/pgtkselect.c +++ b/src/pgtkselect.c @@ -165,7 +165,6 @@ static void get_func (GtkClipboard * cb, GtkSelectionData * data, guint info, gpointer user_data_or_owner) { - PGTK_TRACE ("get_func:"); GObject *obj = G_OBJECT (user_data_or_owner); const char *str; int size; @@ -176,14 +175,12 @@ get_func (GtkClipboard * cb, GtkSelectionData * data, guint info, str = g_object_get_qdata (obj, quark_data); size = GPOINTER_TO_SIZE (g_object_get_qdata (obj, quark_size)); - PGTK_TRACE ("get_func: str: %s", str); gtk_selection_data_set_text (data, str, size); } static void clear_func (GtkClipboard * cb, gpointer user_data_or_owner) { - PGTK_TRACE ("clear_func:"); GObject *obj = G_OBJECT (user_data_or_owner); GQuark quark_data, quark_size; @@ -224,7 +221,6 @@ pgtk_selection_lost (GtkWidget * widget, GdkEventSelection * event, gpointer user_data) { GQuark quark_data, quark_size; - PGTK_TRACE ("pgtk_selection_lost:"); selection_type_to_quarks (event->selection, &quark_data, &quark_size); @@ -340,7 +336,6 @@ FRAME should be a frame that should own the selection. If omitted or nil, it defaults to the selected frame. */) (Lisp_Object selection, Lisp_Object value, Lisp_Object frame) { - PGTK_TRACE ("pgtk-own-selection-internal."); Lisp_Object successful_p = Qnil; Lisp_Object target_symbol, rest; GtkClipboard *cb; @@ -392,19 +387,13 @@ nil, it defaults to the selected frame. */) g_object_set_qdata_full (G_OBJECT (widget), quark_size, GSIZE_TO_POINTER (size), NULL); - PGTK_TRACE ("set_with_owner: owner=%p", FRAME_GTK_WIDGET (f)); if (gtk_clipboard_set_with_owner (cb, targets, n_targets, get_func, clear_func, G_OBJECT (FRAME_GTK_WIDGET (f)))) { - PGTK_TRACE ("set_with_owner succeeded.."); successful_p = Qt; } - else - { - PGTK_TRACE ("set_with_owner failed."); - } gtk_clipboard_set_can_store (cb, NULL, 0); gtk_target_table_free (targets, n_targets); @@ -439,8 +428,6 @@ On MS-DOS, all this does is return non-nil if we own the selection. On PGTK, the TIME-OBJECT is unused. */) (Lisp_Object selection, Lisp_Object time_object, Lisp_Object terminal) { - PGTK_TRACE ("pgtk-disown-selection-internal."); - struct frame *f = frame_for_pgtk_selection (terminal); GtkClipboard *cb; @@ -472,7 +459,6 @@ frame's display, or the first available X display. On Nextstep, TERMINAL is unused. */) (Lisp_Object selection, Lisp_Object terminal) { - PGTK_TRACE ("pgtk-selection-exists-p."); struct frame *f = frame_for_pgtk_selection (terminal); GtkClipboard *cb; @@ -503,7 +489,6 @@ frame's display, or the first available X display. On Nextstep, TERMINAL is unused. */) (Lisp_Object selection, Lisp_Object terminal) { - PGTK_TRACE ("pgtk-selection-owner-p."); struct frame *f = frame_for_pgtk_selection (terminal); GtkClipboard *cb; GObject *obj; @@ -598,14 +583,11 @@ On PGTK, TIME-STAMP is unused. */) void nxatoms_of_pgtkselect (void) { - PGTK_TRACE ("nxatoms_of_pgtkselect"); } void syms_of_pgtkselect (void) { - PGTK_TRACE ("syms_of_pgtkselect"); - DEFSYM (QCLIPBOARD, "CLIPBOARD"); DEFSYM (QSECONDARY, "SECONDARY"); DEFSYM (QTEXT, "TEXT"); diff --git a/src/pgtkterm.c b/src/pgtkterm.c index f306b9c4142..0c286ca1510 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -116,7 +116,6 @@ static struct frame *pgtk_any_window_to_frame (GdkWindow * window); static void flip_cr_context (struct frame *f) { - PGTK_TRACE ("flip_cr_context"); cairo_t *cr = FRAME_CR_ACTIVE_CONTEXT (f); block_input (); @@ -183,7 +182,6 @@ get_keysym_name (int keysym) that it be unique. -------------------------------------------------------------------------- */ { - PGTK_TRACE ("x_get_ksysym_name"); static char value[16]; sprintf (value, "%d", keysym); return value; @@ -195,7 +193,6 @@ frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) Programmatically reposition mouse pointer in pixel coordinates -------------------------------------------------------------------------- */ { - PGTK_TRACE ("frame_set_mouse_pixel_position"); } /* Free X resources of frame F. */ @@ -206,7 +203,6 @@ x_free_frame_resources (struct frame *f) struct pgtk_display_info *dpyinfo; Mouse_HLInfo *hlinfo; - PGTK_TRACE ("x_free_frame_resources"); check_window_system (f); dpyinfo = FRAME_DISPLAY_INFO (f); hlinfo = MOUSE_HL_INFO (f); @@ -300,7 +296,6 @@ x_destroy_window (struct frame *f) -------------------------------------------------------------------------- */ { struct pgtk_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); - PGTK_TRACE ("x_destroy_window"); check_window_system (f); if (dpyinfo->gdpy != NULL) @@ -395,8 +390,6 @@ x_set_offset (struct frame *f, int xoff, int yoff, int change_gravity) External: Position the window -------------------------------------------------------------------------- */ { - PGTK_TRACE ("x_set_offset: %d,%d,%d.", xoff, yoff, change_gravity); - int modified_top, modified_left; if (change_gravity > 0) @@ -465,7 +458,6 @@ pgtk_set_window_size (struct frame *f, bool change_gravity, internal clipping. -------------------------------------------------------------------------- */ { - PGTK_TRACE ("pgtk_set_window_size(%dx%d)", width, height); int pixelwidth, pixelheight; block_input (); @@ -521,8 +513,6 @@ pgtk_iconify_frame (struct frame *f) External: Iconify window -------------------------------------------------------------------------- */ { - PGTK_TRACE ("pgtk_iconify_frame"); - /* Don't keep the highlight on an invisible frame. */ if (FRAME_DISPLAY_INFO (f)->highlight_frame == f) FRAME_DISPLAY_INFO (f)->highlight_frame = 0; @@ -631,8 +621,6 @@ pgtk_make_frame_visible (struct frame *f) External: Show the window (X11 semantics) -------------------------------------------------------------------------- */ { - PGTK_TRACE ("pgtk_make_frame_visible"); - GtkWidget *win = FRAME_GTK_OUTER_WIDGET (f); if (!FRAME_VISIBLE_P (f)) @@ -652,8 +640,6 @@ pgtk_make_frame_invisible (struct frame *f) External: Hide the window (X11 semantics) -------------------------------------------------------------------------- */ { - PGTK_TRACE ("pgtk_make_frame_invisible"); - gtk_widget_hide (FRAME_WIDGET (f)); /* Map events are emitted many times, and @@ -679,7 +665,6 @@ pgtk_make_frame_visible_invisible (struct frame *f, bool visible) static Lisp_Object pgtk_new_font (struct frame *f, Lisp_Object font_object, int fontset) { - PGTK_TRACE ("pgtk_new_font"); struct font *font = XFONT_OBJECT (font_object); int font_ascent, font_descent; @@ -691,28 +676,10 @@ pgtk_new_font (struct frame *f, Lisp_Object font_object, int fontset) { /* This font is already set in frame F. There's nothing more to do. */ - PGTK_TRACE ("already set."); return font_object; } FRAME_FONT (f) = font; - PGTK_TRACE ("font:"); - PGTK_TRACE (" %p", font); - PGTK_TRACE (" name: %s", SSDATA (font_get_name (font_object))); - PGTK_TRACE (" width: %d..%d", font->min_width, font->max_width); - PGTK_TRACE (" pixel_size: %d", font->pixel_size); - PGTK_TRACE (" height: %d", font->height); - PGTK_TRACE (" space_width: %d", font->space_width); - PGTK_TRACE (" average_width: %d", font->average_width); - PGTK_TRACE (" asc/desc: %d,%d", font->ascent, font->descent); - PGTK_TRACE (" ul thickness: %d", font->underline_thickness); - PGTK_TRACE (" ul position: %d", font->underline_position); - PGTK_TRACE (" vertical_centering: %d", font->vertical_centering); - PGTK_TRACE (" baseline_offset: %d", font->baseline_offset); - PGTK_TRACE (" relative_compose: %d", font->relative_compose); - PGTK_TRACE (" default_ascent: %d", font->default_ascent); - PGTK_TRACE (" encoding_charset: %d", font->encoding_charset); - PGTK_TRACE (" repertory_charset: %d", font->repertory_charset); FRAME_BASELINE_OFFSET (f) = font->baseline_offset; FRAME_COLUMN_WIDTH (f) = font->average_width; @@ -754,29 +721,22 @@ pgtk_new_font (struct frame *f, Lisp_Object font_object, int fontset) FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3, false, Qfont); - PGTK_TRACE ("set new."); return font_object; } int x_display_pixel_height (struct pgtk_display_info *dpyinfo) { - PGTK_TRACE ("x_display_pixel_height"); - GdkDisplay *gdpy = dpyinfo->gdpy; GdkScreen *gscr = gdk_display_get_default_screen (gdpy); - PGTK_TRACE (" = %d", gdk_screen_get_height (gscr)); return gdk_screen_get_height (gscr); } int x_display_pixel_width (struct pgtk_display_info *dpyinfo) { - PGTK_TRACE ("x_display_pixel_width"); - GdkDisplay *gdpy = dpyinfo->gdpy; GdkScreen *gscr = gdk_display_get_default_screen (gdpy); - PGTK_TRACE (" = %d", gdk_screen_get_width (gscr)); return gdk_screen_get_width (gscr); } @@ -907,7 +867,6 @@ x_set_no_focus_on_map (struct frame *f, Lisp_Object new_value, * * Some window managers may not honor this parameter. */ { - PGTK_TRACE ("x_set_no_accept_focus_on_map"); /* doesn't work on wayland. */ if (!EQ (new_value, old_value)) @@ -930,7 +889,6 @@ x_set_no_accept_focus (struct frame *f, Lisp_Object new_value, * Some window managers may not honor this parameter. */ { /* doesn't work on wayland. */ - PGTK_TRACE ("x_set_no_accept_focus"); xg_set_no_accept_focus (f, new_value); FRAME_NO_ACCEPT_FOCUS (f) = !NILP (new_value); @@ -948,7 +906,6 @@ x_set_z_group (struct frame *f, Lisp_Object new_value, Lisp_Object old_value) Some window managers may not honor this parameter. */ { /* doesn't work on wayland. */ - PGTK_TRACE ("x_set_z_group"); if (!FRAME_GTK_OUTER_WIDGET (f)) return; @@ -1012,34 +969,25 @@ pgtk_initialize_display_info (struct pgtk_display_info *dpyinfo) static void x_set_cursor_gc (struct glyph_string *s) { - PGTK_TRACE ("x_set_cursor_gc."); if (s->font == FRAME_FONT (s->f) && s->face->background == FRAME_BACKGROUND_PIXEL (s->f) && s->face->foreground == FRAME_FOREGROUND_PIXEL (s->f) && !s->cmp) - PGTK_TRACE ("x_set_cursor_gc: 1."), s->xgcv = FRAME_X_OUTPUT (s->f)->cursor_xgcv; else { /* Cursor on non-default face: must merge. */ Emacs_GC xgcv; - PGTK_TRACE ("x_set_cursor_gc: 2."); xgcv.background = FRAME_X_OUTPUT (s->f)->cursor_color; xgcv.foreground = s->face->background; - PGTK_TRACE ("x_set_cursor_gc: 3. %08lx, %08lx.", xgcv.background, - xgcv.foreground); /* If the glyph would be invisible, try a different foreground. */ if (xgcv.foreground == xgcv.background) xgcv.foreground = s->face->foreground; - PGTK_TRACE ("x_set_cursor_gc: 4. %08lx, %08lx.", xgcv.background, - xgcv.foreground); if (xgcv.foreground == xgcv.background) xgcv.foreground = FRAME_X_OUTPUT (s->f)->cursor_foreground_color; if (xgcv.foreground == xgcv.background) xgcv.foreground = s->face->foreground; - PGTK_TRACE ("x_set_cursor_gc: 5. %08lx, %08lx.", xgcv.background, - xgcv.foreground); /* Make sure the cursor is distinct from text in this face. */ if (xgcv.background == s->face->background @@ -1048,8 +996,6 @@ x_set_cursor_gc (struct glyph_string *s) xgcv.background = s->face->foreground; xgcv.foreground = s->face->background; } - PGTK_TRACE ("x_set_cursor_gc: 6. %08lx, %08lx.", xgcv.background, - xgcv.foreground); s->xgcv = xgcv; } @@ -1116,50 +1062,34 @@ x_set_mode_line_face_gc (struct glyph_string *s) static void x_set_glyph_string_gc (struct glyph_string *s) { - PGTK_TRACE ("x_set_glyph_string_gc: s->f: %08lx, %08lx", - s->f->background_pixel, s->f->foreground_pixel); - PGTK_TRACE ("x_set_glyph_string_gc: s->face: %08lx, %08lx", - s->face->background, s->face->foreground); prepare_face_for_display (s->f, s->face); - PGTK_TRACE ("x_set_glyph_string_gc: s->face: %08lx, %08lx", - s->face->background, s->face->foreground); if (s->hl == DRAW_NORMAL_TEXT) { s->xgcv.foreground = s->face->foreground; s->xgcv.background = s->face->background; s->stippled_p = s->face->stipple != 0; - PGTK_TRACE ("x_set_glyph_string_gc: %08lx, %08lx", s->xgcv.background, - s->xgcv.foreground); } else if (s->hl == DRAW_INVERSE_VIDEO) { x_set_mode_line_face_gc (s); s->stippled_p = s->face->stipple != 0; - PGTK_TRACE ("x_set_glyph_string_gc: %08lx, %08lx", s->xgcv.background, - s->xgcv.foreground); } else if (s->hl == DRAW_CURSOR) { x_set_cursor_gc (s); s->stippled_p = false; - PGTK_TRACE ("x_set_glyph_string_gc: %08lx, %08lx", s->xgcv.background, - s->xgcv.foreground); } else if (s->hl == DRAW_MOUSE_FACE) { x_set_mouse_face_gc (s); s->stippled_p = s->face->stipple != 0; - PGTK_TRACE ("x_set_glyph_string_gc: %08lx, %08lx", s->xgcv.background, - s->xgcv.foreground); } else if (s->hl == DRAW_IMAGE_RAISED || s->hl == DRAW_IMAGE_SUNKEN) { s->xgcv.foreground = s->face->foreground; s->xgcv.background = s->face->background; s->stippled_p = s->face->stipple != 0; - PGTK_TRACE ("x_set_glyph_string_gc: %08lx, %08lx", s->xgcv.background, - s->xgcv.foreground); } else emacs_abort (); @@ -1174,29 +1104,15 @@ x_set_glyph_string_clipping (struct glyph_string *s, cairo_t * cr) { XRectangle r[2]; int n = get_glyph_string_clip_rects (s, r, 2); - PGTK_TRACE ("x_set_glyph_string_clipping: n=%d.", n); if (n > 0) { for (int i = 0; i < n; i++) { - PGTK_TRACE ("x_set_glyph_string_clipping: r[%d]: %ux%u+%d+%d.", - i, r[i].width, r[i].height, r[i].x, r[i].y); cairo_rectangle (cr, r[i].x, r[i].y, r[i].width, r[i].height); } cairo_clip (cr); } - PGTK_TRACE ("clip result:"); - cairo_rectangle_list_t *rects = cairo_copy_clip_rectangle_list (cr); - for (int i = 0; i < rects->num_rectangles; i++) - { - PGTK_TRACE (" rect[%d]: %dx%d+%d+%d.", - i, - (int) rects->rectangles[i].width, - (int) rects->rectangles[i].height, - (int) rects->rectangles[i].x, (int) rects->rectangles[i].y); - } - cairo_rectangle_list_destroy (rects); } @@ -1314,24 +1230,12 @@ fill_background (struct glyph_string *s, int x, int y, int width, int height) static void x_draw_glyph_string_background (struct glyph_string *s, bool force_p) { - PGTK_TRACE ("x_draw_glyph_string_background: 0."); /* Nothing to do if background has already been drawn or if it shouldn't be drawn in the first place. */ if (!s->background_filled_p) { - PGTK_TRACE ("x_draw_glyph_string_background: 1."); int box_line_width = max (s->face->box_horizontal_line_width, 0); - PGTK_TRACE ("x_draw_glyph_string_background: 2. %d, %d.", - FONT_HEIGHT (s->font), s->height - 2 * box_line_width); - PGTK_TRACE ("x_draw_glyph_string_background: 2. %d.", - FONT_TOO_HIGH (s->font)); - PGTK_TRACE ("x_draw_glyph_string_background: 2. %d.", - s->font_not_found_p); - PGTK_TRACE ("x_draw_glyph_string_background: 2. %d.", - s->extends_to_end_of_line_p); - PGTK_TRACE ("x_draw_glyph_string_background: 2. %d.", force_p); - if (s->stippled_p) { /* Fill background with a stipple pattern. */ @@ -1351,7 +1255,6 @@ x_draw_glyph_string_background (struct glyph_string *s, bool force_p) || s->font_not_found_p || s->extends_to_end_of_line_p || force_p) { - PGTK_TRACE ("x_draw_glyph_string_background: 3."); x_clear_glyph_string_rect (s, s->x, s->y + box_line_width, s->background_width, s->height - 2 * box_line_width); @@ -2448,10 +2351,6 @@ x_draw_stretch_glyph_string (struct glyph_string *s) static void pgtk_draw_glyph_string (struct glyph_string *s) { - PGTK_TRACE ("draw_glyph_string."); - PGTK_TRACE ("draw_glyph_string: x=%d, y=%d, width=%d, height=%d.", - s->x, s->y, s->width, s->height); - bool relief_drawn_p = false; /* If S draws into the background of its successors, draw the @@ -2468,7 +2367,6 @@ pgtk_draw_glyph_string (struct glyph_string *s) if (next->first_glyph->type != IMAGE_GLYPH) { cairo_t *cr = pgtk_begin_cr_clip (next->f); - PGTK_TRACE ("pgtk_draw_glyph_string: 1."); x_set_glyph_string_gc (next); x_set_glyph_string_clipping (next, cr); if (next->first_glyph->type == STRETCH_GLYPH) @@ -2481,7 +2379,6 @@ pgtk_draw_glyph_string (struct glyph_string *s) } /* Set up S->gc, set clipping and draw S. */ - PGTK_TRACE ("pgtk_draw_glyph_string: 2."); x_set_glyph_string_gc (s); cairo_t *cr = pgtk_begin_cr_clip (s->f); @@ -2494,7 +2391,6 @@ pgtk_draw_glyph_string (struct glyph_string *s) || s->first_glyph->type == COMPOSITE_GLYPH)) { - PGTK_TRACE ("pgtk_draw_glyph_string: 2.1."); x_set_glyph_string_clipping (s, cr); x_draw_glyph_string_background (s, true); x_draw_glyph_string_box (s); @@ -2508,31 +2404,25 @@ pgtk_draw_glyph_string (struct glyph_string *s) /* We must clip just this glyph. left_overhang part has already drawn when s->prev was drawn, and right_overhang part will be drawn later when s->next is drawn. */ - PGTK_TRACE ("pgtk_draw_glyph_string: 2.2."), x_set_glyph_string_clipping_exactly (s, s, cr); else - PGTK_TRACE ("pgtk_draw_glyph_string: 2.3."), x_set_glyph_string_clipping (s, cr); switch (s->first_glyph->type) { case IMAGE_GLYPH: - PGTK_TRACE ("pgtk_draw_glyph_string: 2.4."); x_draw_image_glyph_string (s); break; case XWIDGET_GLYPH: - PGTK_TRACE ("pgtk_draw_glyph_string: 2.5."); x_draw_xwidget_glyph_string (s); break; case STRETCH_GLYPH: - PGTK_TRACE ("pgtk_draw_glyph_string: 2.6."); x_draw_stretch_glyph_string (s); break; case CHAR_GLYPH: - PGTK_TRACE ("pgtk_draw_glyph_string: 2.7."); if (s->for_overlaps) s->background_filled_p = true; else @@ -2541,7 +2431,6 @@ pgtk_draw_glyph_string (struct glyph_string *s) break; case COMPOSITE_GLYPH: - PGTK_TRACE ("pgtk_draw_glyph_string: 2.8."); if (s->for_overlaps || (s->cmp_from > 0 && !s->first_glyph->u.cmp.automatic)) s->background_filled_p = true; @@ -2551,7 +2440,6 @@ pgtk_draw_glyph_string (struct glyph_string *s) break; case GLYPHLESS_GLYPH: - PGTK_TRACE ("pgtk_draw_glyph_string: 2.9."); if (s->for_overlaps) s->background_filled_p = true; else @@ -2696,7 +2584,6 @@ pgtk_draw_glyph_string (struct glyph_string *s) enum draw_glyphs_face save = prev->hl; prev->hl = s->hl; - PGTK_TRACE ("pgtk_draw_glyph_string: 3."); x_set_glyph_string_gc (prev); cairo_save (cr); x_set_glyph_string_clipping_exactly (s, prev, cr); @@ -2723,7 +2610,6 @@ pgtk_draw_glyph_string (struct glyph_string *s) enum draw_glyphs_face save = next->hl; next->hl = s->hl; - PGTK_TRACE ("pgtk_draw_glyph_string: 4."); x_set_glyph_string_gc (next); cairo_save (cr); x_set_glyph_string_clipping_exactly (s, next, cr); @@ -2759,8 +2645,6 @@ static void pgtk_after_update_window_line (struct window *w, struct glyph_row *desired_row) { - PGTK_TRACE ("after_update_window_line."); - struct frame *f; int width, height; @@ -2791,7 +2675,6 @@ pgtk_after_update_window_line (struct window *w, static void pgtk_clear_frame_area (struct frame *f, int x, int y, int width, int height) { - PGTK_TRACE ("clear_frame_area."); pgtk_clear_area (f, x, y, width, height); } @@ -2941,8 +2824,6 @@ pgtk_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x, int cursor_width, bool on_p, bool active_p) { struct frame *f = XFRAME (w->frame); - PGTK_TRACE ("draw_window_cursor: %d, %d, %d, %d, %d, %d.", - x, y, cursor_type, cursor_width, on_p, active_p); if (on_p) { w->phys_cursor_type = cursor_type; @@ -3002,14 +2883,6 @@ static void pgtk_copy_bits (struct frame *f, cairo_rectangle_t * src_rect, cairo_rectangle_t * dst_rect) { - PGTK_TRACE ("pgtk_copy_bits: %dx%d+%d+%d -> %dx%d+%d+%d", - (int) src_rect->width, - (int) src_rect->height, - (int) src_rect->x, - (int) src_rect->y, - (int) dst_rect->width, - (int) dst_rect->height, (int) dst_rect->x, (int) dst_rect->y); - cairo_t *cr; cairo_surface_t *surface; /* temporary surface */ @@ -3470,9 +3343,6 @@ pgtk_cr_draw_image (struct frame *f, Emacs_GC * gc, cairo_pattern_t * image, { cairo_t *cr = pgtk_begin_cr_clip (f); - PGTK_TRACE ("pgtk_cr_draw_image: 0: %d,%d,%d,%d,%d,%d,%d.", src_x, src_y, - width, height, dest_x, dest_y, overlay_p); - if (overlay_p) cairo_rectangle (cr, dest_x, dest_y, width, height); else @@ -3505,8 +3375,6 @@ static void pgtk_draw_fringe_bitmap (struct window *w, struct glyph_row *row, struct draw_fringe_bitmap_params *p) { - PGTK_TRACE ("draw_fringe_bitmap."); - struct frame *f = XFRAME (WINDOW_FRAME (w)); struct face *face = p->face; @@ -3533,16 +3401,10 @@ pgtk_draw_fringe_bitmap (struct window *w, struct glyph_row *row, } } - PGTK_TRACE ("which: %d, max_fringe_bmp: %d.", p->which, max_fringe_bmp); if (p->which && p->which < max_fringe_bmp) { Emacs_GC gcv; - PGTK_TRACE ("cursor_p=%d.", p->cursor_p); - PGTK_TRACE ("overlay_p_p=%d.", p->overlay_p); - PGTK_TRACE ("background=%08lx.", face->background); - PGTK_TRACE ("cursor_color=%08lx.", FRAME_X_OUTPUT (f)->cursor_color); - PGTK_TRACE ("foreground=%08lx.", face->foreground); gcv.foreground = (p->cursor_p ? (p->overlay_p ? face->background : FRAME_X_OUTPUT (f)->cursor_color) @@ -3652,7 +3514,6 @@ static struct redisplay_interface pgtk_redisplay_interface = { static void pgtk_redraw_scroll_bars (struct frame *f) { - PGTK_TRACE ("pgtk_redraw_scroll_bars"); } void @@ -3661,7 +3522,6 @@ pgtk_clear_frame (struct frame *f) External (hook): Erase the entire frame -------------------------------------------------------------------------- */ { - PGTK_TRACE ("pgtk_clear_frame"); /* comes on initial frame because we have after-make-frame-functions = select-frame */ if (!FRAME_DEFAULT_FACE (f)) @@ -3802,7 +3662,6 @@ pgtk_ring_bell (struct frame *f) static int pgtk_read_socket (struct terminal *terminal, struct input_event *hold_quit) { - PGTK_TRACE ("pgtk_read_socket: enter."); GMainContext *context; bool context_acquired = false; int count; @@ -3810,7 +3669,6 @@ pgtk_read_socket (struct terminal *terminal, struct input_event *hold_quit) count = evq_flush (hold_quit); if (count > 0) { - PGTK_TRACE ("pgtk_read_socket: leave(1)."); return count; } @@ -3818,20 +3676,15 @@ pgtk_read_socket (struct terminal *terminal, struct input_event *hold_quit) context_acquired = g_main_context_acquire (context); block_input (); - PGTK_TRACE ("pgtk_read_socket: 3: errno=%d.", errno); if (context_acquired) { - PGTK_TRACE ("pgtk_read_socket: 4.1: acquired."); while (g_main_context_pending (context)) { - PGTK_TRACE ("pgtk_read_socket: 4: dispatch..."); g_main_context_dispatch (context); - PGTK_TRACE ("pgtk_read_socket: 5: dispatch... done."); } } - PGTK_TRACE ("pgtk_read_socket: 7: errno=%d.", errno); unblock_input (); if (context_acquired) @@ -3840,11 +3693,9 @@ pgtk_read_socket (struct terminal *terminal, struct input_event *hold_quit) count = evq_flush (hold_quit); if (count > 0) { - PGTK_TRACE ("pgtk_read_socket: leave(2)."); return count; } - PGTK_TRACE ("pgtk_read_socket: leave(3)."); return 0; } @@ -3866,11 +3717,8 @@ pgtk_select (int fds_lim, fd_set * rfds, fd_set * wfds, fd_set * efds, int i, nfds, tmo_in_millisec, must_free = 0; bool need_to_dispatch; - PGTK_TRACE ("pgtk_select: enter."); - if (event_q.nr >= 1) { - PGTK_TRACE ("pgtk_select: raise."); raise (SIGIO); errno = EINTR; return -1; @@ -3992,19 +3840,13 @@ pgtk_select (int fds_lim, fd_set * rfds, fd_set * wfds, fd_set * efds, if (need_to_dispatch && context_acquired) { int pselect_errno = errno; - PGTK_TRACE ("retval=%d.", retval); - PGTK_TRACE ("need_to_dispatch=%d.", need_to_dispatch); - PGTK_TRACE ("context_acquired=%d.", context_acquired); - PGTK_TRACE ("pselect_errno=%d.", pselect_errno); /* Prevent g_main_dispatch recursion, that would occur without block_input wrapper, because event handlers call unblock_input. Event loop recursion was causing Bug#15801. */ block_input (); while (g_main_context_pending (context)) { - PGTK_TRACE ("dispatch..."); g_main_context_dispatch (context); - PGTK_TRACE ("dispatch... done."); } unblock_input (); errno = pselect_errno; @@ -4020,7 +3862,6 @@ pgtk_select (int fds_lim, fd_set * rfds, fd_set * wfds, fd_set * efds, errno = EINTR; } - PGTK_TRACE ("pgtk_select: leave."); return retval; } @@ -4064,13 +3905,10 @@ xg_scroll_callback (GtkRange * range, struct scroll_bar *bar = user_data; enum scroll_bar_part part = scroll_bar_nowhere; GtkAdjustment *adj = GTK_ADJUSTMENT (gtk_range_get_adjustment (range)); - PGTK_TRACE ("xg_scroll_callback:"); if (xg_ignore_gtk_scrollbar) return false; - PGTK_TRACE ("xg_scroll_callback: not ignored."); - PGTK_TRACE ("xg_scroll_callback: scroll=%u.", scroll); switch (scroll) { case GTK_SCROLL_JUMP: @@ -4121,8 +3959,6 @@ xg_scroll_callback (GtkRange * range, break; } - PGTK_TRACE ("xg_scroll_callback: part=%u, scroll_bar_nowhere=%d.", part, - scroll_bar_nowhere); if (part != scroll_bar_nowhere) { window_being_scrolled = bar->window; @@ -4140,7 +3976,6 @@ xg_end_scroll_callback (GtkWidget * widget, GdkEventButton * event, gpointer user_data) { struct scroll_bar *bar = user_data; - PGTK_TRACE ("xg_end_scroll_callback:"); bar->dragging = -1; if (WINDOWP (window_being_scrolled)) { @@ -4297,16 +4132,6 @@ pgtk_set_vertical_scroll_bar (struct window *w, int portion, int whole, height = window_height; left = WINDOW_SCROLL_BAR_AREA_X (w); width = WINDOW_SCROLL_BAR_AREA_WIDTH (w); - PGTK_TRACE ("pgtk_set_vertical_scroll_bar: has_vertical_scroll_bar: %d", - WINDOW_HAS_VERTICAL_SCROLL_BAR (w)); - PGTK_TRACE ("pgtk_set_vertical_scroll_bar: config_scroll_bar_width: %d", - WINDOW_CONFIG_SCROLL_BAR_WIDTH (w)); - PGTK_TRACE ("pgtk_set_vertical_scroll_bar: scroll_bar_width: %d", - w->scroll_bar_width); - PGTK_TRACE ("pgtk_set_vertical_scroll_bar: config_scroll_bar_width: %d", - FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w))); - PGTK_TRACE ("pgtk_set_vertical_scroll_bar: %dx%d+%d+%d", width, height, - left, top); /* Does the scroll bar exist yet? */ if (NILP (w->vertical_scroll_bar)) @@ -4603,21 +4428,18 @@ set_fullscreen_state (struct frame *f) switch (f->want_fullscreen) { case FULLSCREEN_NONE: - PGTK_TRACE ("pgtk_fullscreen_hook: none."); gtk_window_unfullscreen (widget); gtk_window_unmaximize (widget); store_frame_param (f, Qfullscreen, Qnil); break; case FULLSCREEN_BOTH: - PGTK_TRACE ("pgtk_fullscreen_hook: both."); gtk_window_unmaximize (widget); gtk_window_fullscreen (widget); store_frame_param (f, Qfullscreen, Qfullboth); break; case FULLSCREEN_MAXIMIZED: - PGTK_TRACE ("pgtk_fullscreen_hook: maximized."); gtk_window_unfullscreen (widget); gtk_window_maximize (widget); store_frame_param (f, Qfullscreen, Qmaximized); @@ -4625,7 +4447,6 @@ set_fullscreen_state (struct frame *f) case FULLSCREEN_WIDTH: case FULLSCREEN_HEIGHT: - PGTK_TRACE ("pgtk_fullscreen_hook: width or height."); /* Not supported by gtk. Ignore them. */ } @@ -4635,7 +4456,6 @@ set_fullscreen_state (struct frame *f) static void pgtk_fullscreen_hook (struct frame *f) { - PGTK_TRACE ("pgtk_fullscreen_hook:"); if (FRAME_VISIBLE_P (f)) { block_input (); @@ -5084,159 +4904,6 @@ pgtk_any_window_to_frame (GdkWindow * window) static gboolean pgtk_handle_event (GtkWidget * widget, GdkEvent * event, gpointer * data) { -#ifdef PGTK_DEBUG - const char *type_name = G_OBJECT_TYPE_NAME (widget); - switch (event->type) - { - case GDK_NOTHING: - PGTK_TRACE ("GDK_NOTHING"); - break; - case GDK_DELETE: - PGTK_TRACE ("GDK_DELETE"); - break; - case GDK_DESTROY: - PGTK_TRACE ("GDK_DESTROY"); - break; - case GDK_EXPOSE: - PGTK_TRACE ("GDK_EXPOSE"); - break; - case GDK_MOTION_NOTIFY: - PGTK_TRACE ("GDK_MOTION_NOTIFY"); - break; - case GDK_BUTTON_PRESS: - PGTK_TRACE ("GDK_BUTTON_PRESS"); - break; - case GDK_2BUTTON_PRESS: - PGTK_TRACE ("GDK_2BUTTON_PRESS"); - break; - case GDK_3BUTTON_PRESS: - PGTK_TRACE ("GDK_3BUTTON_PRESS"); - break; - case GDK_BUTTON_RELEASE: - PGTK_TRACE ("GDK_BUTTON_RELEASE"); - break; - case GDK_KEY_PRESS: - PGTK_TRACE ("GDK_KEY_PRESS"); - break; - case GDK_KEY_RELEASE: - PGTK_TRACE ("GDK_KEY_RELEASE"); - break; - case GDK_ENTER_NOTIFY: - PGTK_TRACE ("GDK_ENTER_NOTIFY"); - break; - case GDK_LEAVE_NOTIFY: - PGTK_TRACE ("GDK_LEAVE_NOTIFY"); - break; - case GDK_FOCUS_CHANGE: - PGTK_TRACE ("GDK_FOCUS_CHANGE"); - break; - case GDK_CONFIGURE: - PGTK_TRACE ("GDK_CONFIGURE"); - break; - case GDK_MAP: - PGTK_TRACE ("GDK_MAP"); - break; - case GDK_UNMAP: - PGTK_TRACE ("GDK_UNMAP"); - break; - case GDK_PROPERTY_NOTIFY: - PGTK_TRACE ("GDK_PROPERTY_NOTIFY"); - break; - case GDK_SELECTION_CLEAR: - PGTK_TRACE ("GDK_SELECTION_CLEAR"); - break; - case GDK_SELECTION_REQUEST: - PGTK_TRACE ("GDK_SELECTION_REQUEST"); - break; - case GDK_SELECTION_NOTIFY: - PGTK_TRACE ("GDK_SELECTION_NOTIFY"); - break; - case GDK_PROXIMITY_IN: - PGTK_TRACE ("GDK_PROXIMITY_IN"); - break; - case GDK_PROXIMITY_OUT: - PGTK_TRACE ("GDK_PROXIMITY_OUT"); - break; - case GDK_DRAG_ENTER: - PGTK_TRACE ("GDK_DRAG_ENTER"); - break; - case GDK_DRAG_LEAVE: - PGTK_TRACE ("GDK_DRAG_LEAVE"); - break; - case GDK_DRAG_MOTION: - PGTK_TRACE ("GDK_DRAG_MOTION"); - break; - case GDK_DRAG_STATUS: - PGTK_TRACE ("GDK_DRAG_STATUS"); - break; - case GDK_DROP_START: - PGTK_TRACE ("GDK_DROP_START"); - break; - case GDK_DROP_FINISHED: - PGTK_TRACE ("GDK_DROP_FINISHED"); - break; - case GDK_CLIENT_EVENT: - PGTK_TRACE ("GDK_CLIENT_EVENT"); - break; - case GDK_VISIBILITY_NOTIFY: - PGTK_TRACE ("GDK_VISIBILITY_NOTIFY"); - break; - case GDK_SCROLL: - PGTK_TRACE ("GDK_SCROLL"); - break; - case GDK_WINDOW_STATE: - PGTK_TRACE ("GDK_WINDOW_STATE"); - break; - case GDK_SETTING: - PGTK_TRACE ("GDK_SETTING"); - break; - case GDK_OWNER_CHANGE: - PGTK_TRACE ("GDK_OWNER_CHANGE"); - break; - case GDK_GRAB_BROKEN: - PGTK_TRACE ("GDK_GRAB_BROKEN"); - break; - case GDK_DAMAGE: - PGTK_TRACE ("GDK_DAMAGE"); - break; - case GDK_TOUCH_BEGIN: - PGTK_TRACE ("GDK_TOUCH_BEGIN"); - break; - case GDK_TOUCH_UPDATE: - PGTK_TRACE ("GDK_TOUCH_UPDATE"); - break; - case GDK_TOUCH_END: - PGTK_TRACE ("GDK_TOUCH_END"); - break; - case GDK_TOUCH_CANCEL: - PGTK_TRACE ("GDK_TOUCH_CANCEL"); - break; - case GDK_TOUCHPAD_SWIPE: - PGTK_TRACE ("GDK_TOUCHPAD_SWIPE"); - break; - case GDK_TOUCHPAD_PINCH: - PGTK_TRACE ("GDK_TOUCHPAD_PINCH"); - break; - case GDK_PAD_BUTTON_PRESS: - PGTK_TRACE ("GDK_PAD_BUTTON_PRESS"); - break; - case GDK_PAD_BUTTON_RELEASE: - PGTK_TRACE ("GDK_PAD_BUTTON_RELEASE"); - break; - case GDK_PAD_RING: - PGTK_TRACE ("GDK_PAD_RING"); - break; - case GDK_PAD_STRIP: - PGTK_TRACE ("GDK_PAD_STRIP"); - break; - case GDK_PAD_GROUP_MODE: - PGTK_TRACE ("GDK_PAD_GROUP_MODE"); - break; - default: - PGTK_TRACE ("GDK_EVENT %d", event->type); - } - PGTK_TRACE (" Widget is %s", type_name); -#endif return FALSE; } @@ -5244,7 +4911,6 @@ static void pgtk_fill_rectangle (struct frame *f, unsigned long color, int x, int y, int width, int height) { - PGTK_TRACE ("pgtk_fill_rectangle"); cairo_t *cr; cr = pgtk_begin_cr_clip (f); pgtk_set_cr_source_with_color (f, color); @@ -5256,7 +4922,6 @@ pgtk_fill_rectangle (struct frame *f, unsigned long color, int x, int y, void pgtk_clear_under_internal_border (struct frame *f) { - PGTK_TRACE ("pgtk_clear_under_internal_border"); if (FRAME_INTERNAL_BORDER_WIDTH (f) > 0) { int border = FRAME_INTERNAL_BORDER_WIDTH (f); @@ -5299,85 +4964,25 @@ pgtk_clear_under_internal_border (struct frame *f) } } -#ifdef HAVE_PGTK - -static void -print_widget_tree_recursive (GtkWidget * w, gpointer user_data) -{ - const char *indent = user_data; - char buf[1024] = ""; - int len = 0; - len += sprintf (buf + len, "%s", indent); - len += - sprintf (buf + len, "%p %s mapped:%d visible:%d", w, - G_OBJECT_TYPE_NAME (w), gtk_widget_get_mapped (w), - gtk_widget_get_visible (w)); - gint wd, hi; - gtk_widget_get_size_request (w, &wd, &hi); - len += sprintf (buf + len, " size_req:%dx%d", wd, hi); - GtkAllocation alloc; - gtk_widget_get_allocation (w, &alloc); - len += - sprintf (buf + len, " alloc:%dx%d+%d+%d", alloc.width, alloc.height, - alloc.x, alloc.y); - len += sprintf (buf + len, " haswin:%d", gtk_widget_get_has_window (w)); - len += sprintf (buf + len, " gdkwin:%p", gtk_widget_get_window (w)); - PGTK_TRACE ("%s", buf); - - if (GTK_IS_CONTAINER (w)) - { - strcpy (buf, indent); - strcat (buf, " "); - gtk_container_foreach (GTK_CONTAINER (w), print_widget_tree_recursive, - buf); - } -} - -static void -print_widget_tree (GtkWidget * w) -{ - char indent[1] = ""; - w = gtk_widget_get_toplevel (w); - print_widget_tree_recursive (w, indent); -} - -#endif - static gboolean pgtk_handle_draw (GtkWidget * widget, cairo_t * cr, gpointer * data) { struct frame *f; - PGTK_TRACE ("pgtk_handle_draw"); - -#ifdef HAVE_PGTK - print_widget_tree (widget); -#endif - GdkWindow *win = gtk_widget_get_window (widget); - PGTK_TRACE (" win=%p", win); if (win != NULL) { cairo_surface_t *src = NULL; f = pgtk_any_window_to_frame (win); - PGTK_TRACE (" f=%p", f); if (f != NULL) { src = FRAME_X_OUTPUT (f)->cr_surface_visible_bell; if (src == NULL && FRAME_CR_ACTIVE_CONTEXT (f) != NULL) src = cairo_get_target (FRAME_CR_ACTIVE_CONTEXT (f)); } - PGTK_TRACE (" surface=%p", src); if (src != NULL) { - PGTK_TRACE (" resized_p=%d", f->resized_p); - PGTK_TRACE (" garbaged=%d", f->garbaged); - PGTK_TRACE (" scroll_bar_width=%f", - (double) PGTK_SCROLL_BAR_WIDTH (f)); - // PGTK_TRACE(" scroll_bar_adjust=%d", PGTK_SCROLL_BAR_ADJUST (f)); - PGTK_TRACE (" scroll_bar_cols=%d", FRAME_SCROLL_BAR_COLS (f)); - PGTK_TRACE (" column_width=%d", FRAME_COLUMN_WIDTH (f)); cairo_set_source_surface (cr, src, 0, 0); cairo_paint (cr); } @@ -5389,9 +4994,6 @@ static void size_allocate (GtkWidget * widget, GtkAllocation * alloc, gpointer user_data) { - PGTK_TRACE ("size-alloc: %dx%d+%d+%d.", alloc->width, alloc->height, - alloc->x, alloc->y); - struct frame *f = pgtk_any_window_to_frame (gtk_widget_get_window (widget)); /* Between a frame is created and not shown, size is allocated and @@ -5407,7 +5009,6 @@ size_allocate (GtkWidget * widget, GtkAllocation * alloc, if (f) { - PGTK_TRACE ("%dx%d", alloc->width, alloc->height); xg_frame_resized (f, alloc->width, alloc->height); pgtk_cr_update_surface_desired_size (f, alloc->width, alloc->height); } @@ -5641,8 +5242,6 @@ key_press_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) USE_SAFE_ALLOCA; - PGTK_TRACE ("key_press_event"); - EVENT_INIT (inev.ie); inev.ie.kind = NO_EVENT; inev.ie.arg = Qnil; @@ -5913,7 +5512,6 @@ done: static gboolean key_release_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) { - PGTK_TRACE ("key_release_event"); return TRUE; } @@ -5943,8 +5541,6 @@ map_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) struct frame *f = pgtk_any_window_to_frame (event->any.window); union buffered_input_event inev; - PGTK_TRACE ("map_event"); - EVENT_INIT (inev.ie); inev.ie.kind = NO_EVENT; inev.ie.arg = Qnil; @@ -6026,8 +5622,6 @@ delete_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) struct frame *f = pgtk_any_window_to_frame (event->any.window); union buffered_input_event inev; - PGTK_TRACE ("delete_event"); - EVENT_INIT (inev.ie); inev.ie.kind = NO_EVENT; inev.ie.arg = Qnil; @@ -6101,7 +5695,6 @@ static gboolean enter_notify_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) { - PGTK_TRACE ("enter_notify_event"); union buffered_input_event inev; struct frame *frame = pgtk_any_window_to_frame (gtk_widget_get_window (widget)); @@ -6128,7 +5721,6 @@ static gboolean leave_notify_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) { - PGTK_TRACE ("leave_notify_event"); union buffered_input_event inev; struct frame *frame = pgtk_any_window_to_frame (gtk_widget_get_window (widget)); @@ -6166,7 +5758,6 @@ leave_notify_event (GtkWidget * widget, GdkEvent * event, static gboolean focus_in_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) { - PGTK_TRACE ("focus_in_event"); union buffered_input_event inev; struct frame *frame = pgtk_any_window_to_frame (gtk_widget_get_window (widget)); @@ -6191,7 +5782,6 @@ focus_in_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) static gboolean focus_out_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) { - PGTK_TRACE ("focus_out_event"); union buffered_input_event inev; struct frame *frame = pgtk_any_window_to_frame (gtk_widget_get_window (widget)); @@ -6268,7 +5858,6 @@ static gboolean motion_notify_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) { - PGTK_TRACE ("motion_notify_event"); union buffered_input_event inev; struct frame *f, *frame; struct pgtk_display_info *dpyinfo; @@ -6422,8 +6011,6 @@ construct_mouse_click (struct input_event *result, static gboolean button_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) { - PGTK_TRACE ("button_event: type=%d, button=%u.", event->button.type, - event->button.button); union buffered_input_event inev; struct frame *f, *frame; struct pgtk_display_info *dpyinfo; @@ -6556,7 +6143,6 @@ button_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) static gboolean scroll_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data) { - PGTK_TRACE ("scroll_event"); union buffered_input_event inev; struct frame *f, *frame; struct pgtk_display_info *dpyinfo; @@ -6657,7 +6243,6 @@ drag_data_received (GtkWidget * widget, GdkDragContext * context, GtkSelectionData * data, guint info, guint time, gpointer user_data) { - PGTK_TRACE ("drag_data_received:"); struct frame *f = pgtk_any_window_to_frame (gtk_widget_get_window (widget)); gchar **uris = gtk_selection_data_get_uris (data); @@ -6668,8 +6253,6 @@ drag_data_received (GtkWidget * widget, GdkDragContext * context, union buffered_input_event inev; Lisp_Object arg = Qnil; - PGTK_TRACE ("drag_data_received: uri: %s", uris[i]); - EVENT_INIT (inev.ie); inev.ie.kind = NO_EVENT; inev.ie.arg = Qnil; @@ -6687,7 +6270,6 @@ drag_data_received (GtkWidget * widget, GdkDragContext * context, evq_enqueue (&inev); } } - PGTK_TRACE ("drag_data_received: that's all."); gtk_drag_finish (context, TRUE, FALSE, time); } @@ -7066,7 +6648,6 @@ pgtk_xlfd_to_fontname (const char *xlfd) The string returned is temporarily allocated. -------------------------------------------------------------------------- */ { - PGTK_TRACE ("pgtk_xlfd_to_fontname"); char *name = xmalloc (180); if (!strncmp (xlfd, "--", 2)) @@ -7084,7 +6665,6 @@ pgtk_xlfd_to_fontname (const char *xlfd) if (strlen (name) == 0) strcpy (name, "Monospace"); - PGTK_TRACE ("converted '%s' to '%s'", xlfd, name); return name; } @@ -7100,7 +6680,6 @@ pgtk_defined_color (struct frame *f, Return false if not found -------------------------------------------------------------------------- */ { - // PGTK_TRACE("pgtk_defined_color(%s)", name); int r; block_input (); @@ -7123,8 +6702,6 @@ int pgtk_parse_color (struct frame *f, const char *color_name, Emacs_Color * color) { - PGTK_TRACE ("pgtk_parse_color: %s", color_name); - GdkRGBA rgba; if (gdk_rgba_parse (&rgba, color_name)) { @@ -7146,7 +6723,6 @@ pgtk_parse_color (struct frame *f, const char *color_name, void pgtk_query_colors (struct frame *f, Emacs_Color * colors, int ncolors) { - PGTK_TRACE ("pgtk_query_colors"); int i; for (i = 0; i < ncolors; i++) @@ -7159,29 +6735,23 @@ pgtk_query_colors (struct frame *f, Emacs_Color * colors, int ncolors) colors[i].red = GetRValue (pixel) * 257; colors[i].green = GetGValue (pixel) * 257; colors[i].blue = GetBValue (pixel) * 257; - PGTK_TRACE ("pixel: %lx, red: %d, blue %d, green %d", colors[i].pixel, - colors[i].red, colors[i].blue, colors[i].green); } } void pgtk_query_color (struct frame *f, Emacs_Color * color) { - PGTK_TRACE ("pgtk_query_color"); pgtk_query_colors (f, color, 1); } void pgtk_clear_area (struct frame *f, int x, int y, int width, int height) { - PGTK_TRACE ("pgtk_clear_area: %dx%d+%d+%d.", width, height, x, y); cairo_t *cr; eassert (width > 0 && height > 0); cr = pgtk_begin_cr_clip (f); - PGTK_TRACE ("back color %08lx.", - (unsigned long) FRAME_X_OUTPUT (f)->background_color); pgtk_set_cr_source_with_color (f, FRAME_X_OUTPUT (f)->background_color); cairo_rectangle (cr, x, y, width, height); cairo_fill (cr); @@ -7322,8 +6892,6 @@ If set to a non-float value, there will be no wait at all. */); void pgtk_cr_update_surface_desired_size (struct frame *f, int width, int height) { - PGTK_TRACE ("pgtk_cr_update_surface_desired_size"); - if (FRAME_CR_SURFACE_DESIRED_WIDTH (f) != width || FRAME_CR_SURFACE_DESIRED_HEIGHT (f) != height) { @@ -7340,7 +6908,6 @@ pgtk_begin_cr_clip (struct frame *f) { cairo_t *cr = FRAME_CR_CONTEXT (f); - PGTK_TRACE ("pgtk_begin_cr_clip"); if (!cr) { cairo_surface_t *surface = @@ -7363,28 +6930,24 @@ pgtk_begin_cr_clip (struct frame *f) void pgtk_end_cr_clip (struct frame *f) { - PGTK_TRACE ("pgtk_end_cr_clip"); cairo_restore (FRAME_CR_CONTEXT (f)); } void pgtk_set_cr_source_with_gc_foreground (struct frame *f, Emacs_GC * gc) { - PGTK_TRACE ("pgtk_set_cr_source_with_gc_foreground: %08lx", gc->foreground); pgtk_set_cr_source_with_color (f, gc->foreground); } void pgtk_set_cr_source_with_gc_background (struct frame *f, Emacs_GC * gc) { - PGTK_TRACE ("pgtk_set_cr_source_with_gc_background: %08lx", gc->background); pgtk_set_cr_source_with_color (f, gc->background); } void pgtk_set_cr_source_with_color (struct frame *f, unsigned long color) { - PGTK_TRACE ("pgtk_set_cr_source_with_color: %08lx.", color); Emacs_Color col; col.pixel = color; pgtk_query_color (f, &col); @@ -7395,7 +6958,6 @@ pgtk_set_cr_source_with_color (struct frame *f, unsigned long color) void pgtk_cr_draw_frame (cairo_t * cr, struct frame *f) { - PGTK_TRACE ("pgtk_cr_draw_frame"); cairo_set_source_surface (cr, FRAME_CR_SURFACE (f), 0, 0); cairo_paint (cr); } @@ -7414,7 +6976,6 @@ pgtk_cr_accumulate_data (void *closure, const unsigned char *data, void pgtk_cr_destroy_frame_context (struct frame *f) { - PGTK_TRACE ("pgtk_cr_destroy_frame_context"); if (FRAME_CR_CONTEXT (f) != NULL) { cairo_destroy (FRAME_CR_CONTEXT (f)); diff --git a/src/pgtkterm.h b/src/pgtkterm.h index 46266fdfd9e..635c5e6a615 100644 --- a/src/pgtkterm.h +++ b/src/pgtkterm.h @@ -38,20 +38,6 @@ along with GNU Emacs. If not, see . */ #include #endif -// #define PGTK_DEBUG 1 - -#ifdef PGTK_DEBUG -extern void -pgtk_log (const char *file, int lineno, const char *fmt, ...) -ATTRIBUTE_FORMAT_PRINTF (3, 4); -#define PGTK_TRACE(fmt, ...) pgtk_log (__FILE__, __LINE__, fmt, ## __VA_ARGS__) - extern void pgtk_backtrace (const char *file, int lineno); -#define PGTK_BACKTRACE() pgtk_backtrace (__FILE__, __LINE__) -#else -#define PGTK_TRACE(fmt, ...) ((void) 0) -#define PGTK_BACKTRACE() ((void) 0) -#endif - /* could use list to store these, but rest of emacs has a big infrastructure for managing a table of bitmap "records" */ struct pgtk_bitmap_record