g_object_notify (G_OBJECT (window), "window_position");
}
+/**
+ * gtk_window_activate_focus:
+ * @window: a #GtkWindow
+ *
+ * Activates the current focused widget within the window.
+ *
+ * Return value: %TRUE if a widget got activated.
+ **/
gboolean
gtk_window_activate_focus (GtkWindow *window)
{
return window->focus_widget;
}
+/**
+ * gtk_window_activate_default:
+ * @window: a #GtkWindow
+ *
+ * Activates the default widget for the window, unless the current
+ * focused widget has been configured to receive the default action
+ * (see #GTK_RECEIVES_DEFAULT in #GtkWidgetFlags), in which case the
+ * focused widget is activated.
+ *
+ * Return value: %TRUE if a widget got activated.
+ **/
gboolean
gtk_window_activate_default (GtkWindow *window)
{
{
g_return_if_fail (GTK_IS_WINDOW (window));
- window->modal = modal != FALSE;
+ modal = modal != FALSE;
+ if (window->modal == modal)
+ return;
+
+ window->modal = modal;
/* adjust desired modality state */
- if (GTK_WIDGET_VISIBLE (window) && window->modal)
- gtk_grab_add (GTK_WIDGET (window));
- else
- gtk_grab_remove (GTK_WIDGET (window));
+ if (GTK_WIDGET_REALIZED (window))
+ {
+ GtkWidget *widget = GTK_WIDGET (window);
+
+ if (window->modal)
+ gdk_window_set_modal_hint (widget->window, TRUE);
+ else
+ gdk_window_set_modal_hint (widget->window, FALSE);
+ }
+
+ if (GTK_WIDGET_VISIBLE (window))
+ {
+ if (window->modal)
+ gtk_grab_add (GTK_WIDGET (window));
+ else
+ gtk_grab_remove (GTK_WIDGET (window));
+ }
g_object_notify (G_OBJECT (window), "modal");
}
* Windows may set a hint asking the desktop environment not to display
* the window in the task bar. This function toggles this hint.
*
+ * Since: 2.2
**/
void
gtk_window_set_skip_taskbar_hint (GtkWindow *window,
* Gets the value set by gtk_window_set_skip_taskbar_hint()
*
* Return value: %TRUE if window shouldn't be in taskbar
+ *
+ * Since: 2.2
**/
gboolean
gtk_window_get_skip_taskbar_hint (GtkWindow *window)
* switcher that displays a thumbnail representation of the windows
* on the screen.)
*
+ * Since: 2.2
**/
void
gtk_window_set_skip_pager_hint (GtkWindow *window,
* Gets the value set by gtk_window_set_skip_pager_hint().
*
* Return value: %TRUE if window shouldn't be in pager
+ *
+ * Since: 2.2
**/
gboolean
gtk_window_get_skip_pager_hint (GtkWindow *window)
* with a pixbuf created by loading the image from @filename.
*
* Returns: %TRUE if setting the icon succeeded.
+ *
+ * Since: 2.2
**/
gboolean
gtk_window_set_icon_from_file (GtkWindow *window,
* on disk. Warns on failure if @err is %NULL.
*
* Returns: %TRUE if setting the icon succeeded.
+ *
+ * Since: 2.2
**/
gboolean
gtk_window_set_default_icon_from_file (const gchar *filename,
if (gtk_window_get_skip_taskbar_hint (window))
gdk_window_set_skip_taskbar_hint (widget->window, TRUE);
- /* transient_for must be set to allow the modal hint */
- if (window->transient_parent && window->modal)
+ if (window->modal)
gdk_window_set_modal_hint (widget->window, TRUE);
else
gdk_window_set_modal_hint (widget->window, FALSE);
new_request.width, new_request.height);
}
else
- if (widget->window)
- gdk_window_move_resize (widget->window,
- new_request.x, new_request.y,
- new_request.width, new_request.height);
+ gdk_window_move_resize (widget->window,
+ new_request.x, new_request.y,
+ new_request.width, new_request.height);
}
else /* only size changed */
{
gdk_window_resize (window->frame,
new_request.width + window->frame_left + window->frame_right,
new_request.height + window->frame_top + window->frame_bottom);
- if (widget->window)
- gdk_window_resize (widget->window,
- new_request.width, new_request.height);
+ gdk_window_resize (widget->window,
+ new_request.width, new_request.height);
}
/* Increment the number of have-not-yet-received-notify requests */
* You can track the fullscreen state via the "window_state_event" signal
* on #GtkWidget.
*
+ * Since: 2.2
**/
void
gtk_window_fullscreen (GtkWindow *window)
* You can track the fullscreen state via the "window_state_event" signal
* on #GtkWidget.
*
+ * Since: 2.2
**/
void
gtk_window_unfullscreen (GtkWindow *window)
* Sets the #GdkScreen where the @window is displayed; if
* the window is already mapped, it will be unmapped, and
* then remapped on the new screen.
+ *
+ * Since: 2.2
*/
void
gtk_window_set_screen (GtkWindow *window,
* Returns the #GdkScreen associated with @window.
*
* Return value: a #GdkScreen.
+ *
+ * Since: 2.2
*/
GdkScreen*
gtk_window_get_screen (GtkWindow *window)
* temporarily, show your splash screen, then re-enable it so that
* showing the main window would automatically result in notification.
*
+ * Since: 2.2
**/
void
gtk_window_set_auto_startup_notification (gboolean setting)