(f, Qxg_frame_set_char_size_1, width, height,
list2i (gheight, totalheight));
+#ifndef HAVE_PGTK
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
gwidth, totalheight);
+#else
+ if (FRAME_GTK_OUTER_WIDGET (f))
+ {
+ gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
+ gwidth, totalheight);
+ }
+ else
+ {
+ gtk_widget_set_size_request (FRAME_GTK_WIDGET (f),
+ gwidth, totalheight);
+ }
+#endif
}
else if (EQ (fullscreen, Qfullheight) && height == FRAME_TEXT_HEIGHT (f))
{
(f, Qxg_frame_set_char_size_2, width, height,
list2i (gwidth, totalwidth));
+#ifndef HAVE_PGTK
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
totalwidth, gheight);
+#else
+ if (FRAME_GTK_OUTER_WIDGET (f))
+ {
+ gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
+ totalwidth, gheight);
+ }
+ else
+ {
+ gtk_widget_set_size_request (FRAME_GTK_WIDGET (f),
+ totalwidth, gheight);
+ }
+#endif
}
else if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f))
{
void
xg_set_undecorated (struct frame *f, Lisp_Object undecorated)
{
+#ifdef HAVE_PGTK
+ if (!FRAME_GTK_OUTER_WIDGET (f))
+ return;
+#endif
if (FRAME_GTK_WIDGET (f))
{
block_input ();
void
xg_set_no_focus_on_map (struct frame *f, Lisp_Object no_focus_on_map)
{
+#ifdef HAVE_PGTK
+ if (!FRAME_GTK_OUTER_WIDGET (f))
+ return;
+#endif
block_input ();
if (FRAME_GTK_WIDGET (f))
{
void
xg_set_no_accept_focus (struct frame *f, Lisp_Object no_accept_focus)
{
- block_input ();
- if (
-#ifndef HAVE_PGTK
- FRAME_GTK_WIDGET (f)
-#else
- FRAME_GTK_OUTER_WIDGET (f)
+#ifdef HAVE_PGTK
+ if (!FRAME_GTK_OUTER_WIDGET (f))
+ 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;
void
xg_set_frame_icon (struct frame *f, Pixmap icon_pixmap, Pixmap icon_mask)
{
+#ifdef HAVE_PGTK
+ if (!FRAME_GTK_OUTER_WIDGET (f))
+ return;
+#endif
GdkPixbuf *gp = xg_get_pixbuf_from_pix_and_mask (f,
icon_pixmap,
icon_mask);
int filesel_done = 0;
xg_get_file_func func;
+#ifdef HAVE_PGTK
+ if (!FRAME_GTK_OUTER_WIDGET (f))
+ error("Can't open dialog from child frames");
+#endif
+
#ifdef HAVE_GTK_FILE_SELECTION_NEW
if (xg_uses_old_file_dialog ())
int done = 0;
Lisp_Object font = Qnil;
+#ifdef HAVE_PGTK
+ if (!FRAME_GTK_OUTER_WIDGET (f))
+ error("Can't open dialog from child frames");
+#endif
+
w = gtk_font_chooser_dialog_new
("Pick a font", GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
bool result = false;
Lisp_Object found;
+ if (!FRAME_GTK_OUTER_WIDGET (f))
+ return false;
+
found = image_find_image_file (file);
if (!NILP (found))
if (!pixbuf)
return false;
+ if (!FRAME_GTK_OUTER_WIDGET (f))
+ return false;
+
gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), pixbuf);
g_object_unref (pixbuf);
return true;
pgtk_set_sticky (struct frame *f, Lisp_Object new_value,
Lisp_Object old_value)
{
+ if (!FRAME_GTK_OUTER_WIDGET (f))
+ return;
+
if (!NILP (new_value))
gtk_window_stick (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
else
frame = selected_frame;
f = decode_window_system_frame (frame);
+ if (!FRAME_GTK_OUTER_WIDGET (f))
+ return unbind_to (count, Qnil);
+
if (NILP (timeout))
timeout = make_fixnum (5);
else
(Lisp_Object x, Lisp_Object y)
{
struct frame *f = SELECTED_FRAME ();
- GtkWidget *widget = FRAME_GTK_OUTER_WIDGET (f);
+ GtkWidget *widget = gtk_widget_get_toplevel (FRAME_WIDGET (f));
GdkWindow *window = gtk_widget_get_window (widget);
GdkDisplay *gdpy = gdk_window_get_display (window);
GdkScreen *gscr = gdk_window_get_screen (window);
(void)
{
struct frame *f = SELECTED_FRAME ();
- GtkWidget *widget = FRAME_GTK_OUTER_WIDGET (f);
+ GtkWidget *widget = gtk_widget_get_toplevel (FRAME_WIDGET (f));
GdkWindow *window = gtk_widget_get_window (widget);
GdkDisplay *gdpy = gdk_window_get_display (window);
GdkScreen *gscr;
*error_name = NULL;
+ if (!FRAME_GTK_OUTER_WIDGET (f)) {
+ *error_name = "Can't popup from child frames.";
+ return Qnil;
+ }
+
if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
{
*error_name = "Empty menu";
*error_name = NULL;
+ if (!FRAME_GTK_OUTER_WIDGET (f)) {
+ *error_name = "Can't popup from child frames.";
+ return Qnil;
+ }
+
if (menu_items_n_panes > 1)
{
*error_name = "Multiple panes in dialog box";
GtkWidget *wid = FRAME_GTK_OUTER_WIDGET (f);
- if (dpyinfo->x_focus_frame != f)
+ if (dpyinfo->x_focus_frame != f && wid != NULL)
{
block_input ();
gtk_window_present (GTK_WINDOW (wid));
}
#endif
- set_opacity_recursively (FRAME_GTK_OUTER_WIDGET (f), &alpha);
+ set_opacity_recursively (FRAME_WIDGET (f), &alpha);
/* without this, blending mode is strange on wayland. */
- gtk_widget_queue_resize_no_redraw (FRAME_GTK_OUTER_WIDGET (f));
+ gtk_widget_queue_resize_no_redraw (FRAME_WIDGET (f));
}
static void
dpyinfo->x_focus_frame = frame;
if (old_focus && old_focus->auto_lower)
- gdk_window_lower (gtk_widget_get_window
- (FRAME_GTK_OUTER_WIDGET (old_focus)));
+ if (FRAME_GTK_OUTER_WIDGET (old_focus))
+ gdk_window_lower (gtk_widget_get_window
+ (FRAME_GTK_OUTER_WIDGET (old_focus)));
if (dpyinfo->x_focus_frame && dpyinfo->x_focus_frame->auto_raise)
- gdk_window_raise (gtk_widget_get_window
- (FRAME_GTK_OUTER_WIDGET (dpyinfo->x_focus_frame)));
+ if (FRAME_GTK_OUTER_WIDGET (dpyinfo->x_focus_frame))
+ gdk_window_raise (gtk_widget_get_window
+ (FRAME_GTK_OUTER_WIDGET (dpyinfo->x_focus_frame)));
}
pgtk_frame_rehighlight (dpyinfo);
GDK_ACTION_COPY);
gtk_drag_dest_add_uri_targets (FRAME_GTK_WIDGET (f));
- g_signal_connect (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)),
- "window-state-event", G_CALLBACK (window_state_event),
- NULL);
- g_signal_connect (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), "delete-event",
- G_CALLBACK (delete_event), NULL);
- g_signal_connect (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), "event",
- G_CALLBACK (pgtk_handle_event), NULL);
- g_signal_connect (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), "configure-event",
- G_CALLBACK (configure_event), NULL);
+ if (FRAME_GTK_OUTER_WIDGET (f))
+ {
+ g_signal_connect (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)),
+ "window-state-event", G_CALLBACK (window_state_event),
+ NULL);
+ g_signal_connect (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), "delete-event",
+ G_CALLBACK (delete_event), NULL);
+ g_signal_connect (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), "event",
+ G_CALLBACK (pgtk_handle_event), NULL);
+ g_signal_connect (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), "configure-event",
+ G_CALLBACK (configure_event), NULL);
+ }
g_signal_connect (G_OBJECT (FRAME_GTK_WIDGET (f)), "map-event",
G_CALLBACK (map_event), NULL);