/* Get these here because they can't be got in configure_event(). */
int left_pos, top_pos;
- if (FRAME_GTK_OUTER_WIDGET (f)) {
- gtk_window_get_position (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
- &left_pos, &top_pos);
- } else {
- if (FRAME_GTK_WIDGET (f) == NULL)
- return Qnil; /* This can occur while creating a frame. */
- GtkAllocation alloc;
- gtk_widget_get_allocation (FRAME_GTK_WIDGET (f), &alloc);
- left_pos = alloc.x;
- top_pos = alloc.y;
- }
+
+ if (FRAME_GTK_OUTER_WIDGET (f))
+ {
+ gtk_window_get_position (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
+ &left_pos, &top_pos);
+ }
+ else
+ {
+ GtkAllocation alloc;
+
+ if (FRAME_GTK_WIDGET (f) == NULL)
+ return Qnil; /* This can occur while creating a frame. */
+
+ gtk_widget_get_allocation (FRAME_GTK_WIDGET (f), &alloc);
+ left_pos = alloc.x;
+ top_pos = alloc.y;
+ }
int native_left = left_pos + border;
int native_top = top_pos + border + title_height;
gtk_container_remove (GTK_CONTAINER (whbox_of_f), fixed);
GtkStyleContext *ctxt = gtk_widget_get_style_context (FRAME_WIDGET (f));
- gtk_style_context_remove_provider (ctxt, GTK_STYLE_PROVIDER (provider));
+ if (provider)
+ gtk_style_context_remove_provider (ctxt, GTK_STYLE_PROVIDER (provider));
if (FRAME_GTK_OUTER_WIDGET (f))
{
}
GtkStyleContext *ctxt = gtk_widget_get_style_context (FRAME_WIDGET (f));
- gtk_style_context_add_provider (ctxt, GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_USER);
+ if (provider)
+ gtk_style_context_add_provider (ctxt, GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
g_object_unref (fixed);
- if (FRAME_GTK_OUTER_WIDGET (f)) {
- if (EQ (x_gtk_resize_child_frames, Qresize_mode))
- gtk_container_set_resize_mode
- (GTK_CONTAINER (FRAME_GTK_OUTER_WIDGET (f)),
- p ? GTK_RESIZE_IMMEDIATE : GTK_RESIZE_QUEUE);
- }
+ if (FRAME_GTK_OUTER_WIDGET (f))
+ {
+ if (EQ (x_gtk_resize_child_frames, Qresize_mode))
+ gtk_container_set_resize_mode
+ (GTK_CONTAINER (FRAME_GTK_OUTER_WIDGET (f)),
+ p ? GTK_RESIZE_IMMEDIATE : GTK_RESIZE_QUEUE);
+ }
unblock_input ();
bool
pgtk_text_icon (struct frame *f, const char *icon_name)
{
- if (FRAME_GTK_OUTER_WIDGET (f)) {
- gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), NULL);
- gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), icon_name);
- }
+ if (FRAME_GTK_OUTER_WIDGET (f))
+ {
+ gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), NULL);
+ gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), icon_name);
+ }
return false;
}
}
static gboolean
-key_release_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
+key_release_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer *user_data)
{
return TRUE;
}
static gboolean
-configure_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
+configure_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer *user_data)
{
struct frame *f = pgtk_any_window_to_frame (event->configure.window);
if (f && widget == FRAME_GTK_OUTER_WIDGET (f))
}
static gboolean
-map_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
+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;
}
static gboolean
-window_state_event (GtkWidget * widget, GdkEvent * event,
- gpointer * user_data)
+window_state_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer *user_data)
{
struct frame *f = pgtk_any_window_to_frame (event->window_state.window);
union buffered_input_event inev;
}
static gboolean
-delete_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
+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;
}
static gboolean
-enter_notify_event (GtkWidget * widget, GdkEvent * event,
- gpointer * user_data)
+enter_notify_event (GtkWidget *widget, GdkEvent *event,
+ gpointer *user_data)
{
union buffered_input_event inev;
struct frame *frame =