all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Po Lu <luangruo@yahoo.com>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	52705@debbugs.gnu.org, Aleksandr Vityazev <avityazev@posteo.org>
Subject: bug#52705: 29.0.50; Flashing popups when x-gtk-use-system-tooltips is nil in pgtk
Date: Fri, 24 Dec 2021 17:03:13 +0100	[thread overview]
Message-ID: <bb08564c-4906-0159-1f36-231266069672@gmx.at> (raw)
In-Reply-To: <87zgoqcmnx.fsf@yahoo.com>

 > Thanks, I'm beginning to understand the problem.
 >
 > Try removing this part of `x_create_tip_frame' in pgtkfns.c:
 >
 >    gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
 >
 >
 > And adding `gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (tip_f))' to
 > this part of x-show-tip in that file:
 >
 >    /* Show tooltip frame.  */
 >    block_input ();
 >    gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (tip_f)), width, height);
 >    gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (tip_f)), root_x, root_y);
 >    unblock_input ();

I did

diff --git a/src/pgtkfns.c b/src/pgtkfns.c
index 8cea9a9270..93f460a606 100644
--- a/src/pgtkfns.c
+++ b/src/pgtkfns.c
@@ -2989,7 +2989,6 @@ x_create_tip_frame (struct pgtk_display_info *dpyinfo, Lisp_Object parms, struct
    gtk_window_set_decorated (GTK_WINDOW (tip_window), FALSE);
    gtk_window_set_type_hint (GTK_WINDOW (tip_window), GDK_WINDOW_TYPE_HINT_TOOLTIP);
    f->output_data.pgtk->current_cursor = f->output_data.pgtk->text_cursor;
-  gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
    gdk_window_set_cursor (gtk_widget_get_window (FRAME_GTK_OUTER_WIDGET (f)),
  			 f->output_data.pgtk->current_cursor);

@@ -3527,6 +3526,8 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
    block_input ();
    gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (tip_f)), width, height);
    gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (tip_f)), root_x, root_y);
+  gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (tip_f));
+  SET_FRAME_VISIBLE (tip_f, 1);
    unblock_input ();

    pgtk_cr_update_surface_desired_size (tip_f, width, height, false);

and it seems to work flawlessly - the SET_FRAME_VISIBLE is utterly
needed here to make the check on line 3203 of pgtkfns.c succeed (or
better, fail).

More importantly, the initial phantom frame with a simple

(setq x-gtk-use-system-tooltips nil)

disappears so you can make Aleksandr happy ...

Unfortunately, I'm now getting

(emacs:2257): Gdk-CRITICAL **: 16:19:41.208: gdk_window_set_cursor: assertion 'GDK_IS_WINDOW (window)' failed

(emacs:2257): Gdk-CRITICAL **: 16:19:41.231: gdk_window_create_similar_surface: assertion 'GDK_IS_WINDOW (window)' failed

which I do not get without the patch.  Any ideas?

martin





  reply	other threads:[~2021-12-24 16:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21 15:27 bug#52705: 29.0.50; Flashing popups when x-gtk-use-system-tooltips is nil Aleksandr Vityazev
2021-12-22 14:37 ` Lars Ingebrigtsen
2021-12-24  8:08   ` bug#52705: 29.0.50; Flashing popups when x-gtk-use-system-tooltips is nil in pgtk Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-24  8:43     ` martin rudalics
2021-12-24  9:35       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-24 10:19         ` martin rudalics
2021-12-24 10:38           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-24 16:03             ` martin rudalics [this message]
2021-12-25  0:30               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-25  9:17                 ` martin rudalics
2021-12-25  9:39                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-25 17:16                     ` martin rudalics
2021-12-26  1:22                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-26  8:25                         ` martin rudalics
2022-01-02 12:14                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-02 12:33                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bb08564c-4906-0159-1f36-231266069672@gmx.at \
    --to=rudalics@gmx.at \
    --cc=52705@debbugs.gnu.org \
    --cc=avityazev@posteo.org \
    --cc=larsi@gnus.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.