void
xg_set_no_accept_focus (struct frame *f, Lisp_Object no_accept_focus)
{
+ gboolean g_no_accept_focus = NILP (no_accept_focus) ? TRUE : FALSE;
#ifdef HAVE_PGTK
if (!FRAME_GTK_OUTER_WIDGET (f))
- return;
+ {
+ if (FRAME_WIDGET(f))
+ gtk_widget_set_can_focus (FRAME_WIDGET(f), g_no_accept_focus);
+ return;
+ }
#endif
block_input ();
if (FRAME_GTK_WIDGET (f))
{
GtkWindow *gwin = GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f));
- gboolean g_no_accept_focus = NILP (no_accept_focus) ? TRUE : FALSE;
-
gtk_window_set_accept_focus (gwin, g_no_accept_focus);
}
unblock_input ();
{
struct pgtk_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
- GtkWidget *wid = FRAME_GTK_OUTER_WIDGET (f);
+ GtkWidget *wid = FRAME_WIDGET (f);
if (dpyinfo->x_focus_frame != f && wid != NULL)
{
block_input ();
- gtk_window_present (GTK_WINDOW (wid));
+ gtk_widget_grab_focus(wid);
unblock_input ();
}
}
if (FRAME_PARENT_FRAME (f) || (hf && frame_ancestor_p (f, hf)))
{
block_input ();
-#if 0
- XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
- RevertToParent, CurrentTime);
- if (FRAME_PARENT_FRAME (f))
- XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f));
-#endif
+ gtk_widget_grab_focus(FRAME_GTK_WIDGET(f));
+ if (FRAME_GTK_OUTER_WIDGET (f))
+ {
+ gtk_window_present (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
+ }
unblock_input ();
}
}