aboutsummaryrefslogtreecommitdiffstats
path: root/src/pgtkterm.c
diff options
context:
space:
mode:
authorJeff Walsh2021-09-27 00:20:57 +1000
committerYuuki Harano2021-11-15 21:07:28 +0900
commit6c1f0dd709a77a2fade006b5957553fc5abd7631 (patch)
treec68c4a290512343e3732edcb375937f0f9c3380c /src/pgtkterm.c
parentf1a60225152af1f87d8580db0785cf5a0a9c7544 (diff)
downloademacs-6c1f0dd709a77a2fade006b5957553fc5abd7631.tar.gz
emacs-6c1f0dd709a77a2fade006b5957553fc5abd7631.zip
pgtk: Handle (child) frame focusing better
child frames on pgtk are gtk widgets inside the parent surface, rather than subsurfaces (in wayland ters), and the edit widget is handled separately from the parent window, so we need to handle signals more correctly, rather than squinting and assuming an event for the window is just an event for the edit widget. * src/gtkutil.c (xg_set_no_accept_focus): set focus on widget rather than request it on window * src/pgtkterm.c (pgtk_focus_frame): focus frame on edit_widget instead (button_event): Implement focus calls to replace dead X calls
Diffstat (limited to 'src/pgtkterm.c')
-rw-r--r--src/pgtkterm.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 75386ee6c39..978d4798d5f 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -4702,12 +4702,12 @@ pgtk_focus_frame (struct frame *f, bool noactivate)
4702{ 4702{
4703 struct pgtk_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); 4703 struct pgtk_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
4704 4704
4705 GtkWidget *wid = FRAME_GTK_OUTER_WIDGET (f); 4705 GtkWidget *wid = FRAME_WIDGET (f);
4706 4706
4707 if (dpyinfo->x_focus_frame != f && wid != NULL) 4707 if (dpyinfo->x_focus_frame != f && wid != NULL)
4708 { 4708 {
4709 block_input (); 4709 block_input ();
4710 gtk_window_present (GTK_WINDOW (wid)); 4710 gtk_widget_grab_focus(wid);
4711 unblock_input (); 4711 unblock_input ();
4712 } 4712 }
4713} 4713}
@@ -6460,12 +6460,11 @@ button_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
6460 if (FRAME_PARENT_FRAME (f) || (hf && frame_ancestor_p (f, hf))) 6460 if (FRAME_PARENT_FRAME (f) || (hf && frame_ancestor_p (f, hf)))
6461 { 6461 {
6462 block_input (); 6462 block_input ();
6463#if 0 6463 gtk_widget_grab_focus(FRAME_GTK_WIDGET(f));
6464 XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), 6464 if (FRAME_GTK_OUTER_WIDGET (f))
6465 RevertToParent, CurrentTime); 6465 {
6466 if (FRAME_PARENT_FRAME (f)) 6466 gtk_window_present (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
6467 XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f)); 6467 }
6468#endif
6469 unblock_input (); 6468 unblock_input ();
6470 } 6469 }
6471 } 6470 }