2008-07-01 22:57:50 +00:00
|
|
|
|
/* GTK - The GIMP Toolkit
|
1997-11-24 22:37:52 +00:00
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1997-11-24 22:37:52 +00:00
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-24 22:37:52 +00:00
|
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
|
*/
|
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
|
#include "config.h"
|
2010-12-18 01:41:16 +00:00
|
|
|
|
|
|
|
|
|
#include "gtkwindowprivate.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
|
2010-12-24 01:19:59 +00:00
|
|
|
|
#include "gtkaccelgroupprivate.h"
|
2020-04-22 17:32:10 +00:00
|
|
|
|
#include "gtkactionable.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtkapplicationprivate.h"
|
2020-05-09 12:26:52 +00:00
|
|
|
|
#include "gtkbox.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtkbuildable.h"
|
|
|
|
|
#include "gtkbuilderprivate.h"
|
|
|
|
|
#include "gtkcheckbutton.h"
|
2013-08-22 17:20:10 +00:00
|
|
|
|
#include "gtkcsscornervalueprivate.h"
|
2020-01-10 12:02:33 +00:00
|
|
|
|
#include "gtkcsscolorvalueprivate.h"
|
2020-01-14 13:34:15 +00:00
|
|
|
|
#include "gtkcssshadowvalueprivate.h"
|
2020-02-29 02:47:17 +00:00
|
|
|
|
#include "gtkdroptargetasync.h"
|
2020-04-15 18:43:00 +00:00
|
|
|
|
#include "gtkeventcontrollerlegacy.h"
|
2018-06-06 23:23:59 +00:00
|
|
|
|
#include "gtkeventcontrollerkey.h"
|
2018-06-27 10:42:06 +00:00
|
|
|
|
#include "gtkeventcontrollermotion.h"
|
2019-05-29 17:10:46 +00:00
|
|
|
|
#include "gtkgestureclick.h"
|
2020-04-22 17:39:40 +00:00
|
|
|
|
#include "gtkheaderbar.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtkicontheme.h"
|
|
|
|
|
#include "gtkintl.h"
|
1998-08-11 19:06:18 +00:00
|
|
|
|
#include "gtkmain.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtkmarshalers.h"
|
|
|
|
|
#include "gtkmessagedialog.h"
|
|
|
|
|
#include "gtkpointerfocusprivate.h"
|
|
|
|
|
#include "gtkprivate.h"
|
2018-04-06 18:30:34 +00:00
|
|
|
|
#include "gtkroot.h"
|
2020-08-13 23:21:05 +00:00
|
|
|
|
#include "gtknativeprivate.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtksettings.h"
|
2018-08-05 02:10:11 +00:00
|
|
|
|
#include "gtkshortcut.h"
|
2018-08-15 04:43:31 +00:00
|
|
|
|
#include "gtkshortcutcontroller.h"
|
2020-02-06 15:43:55 +00:00
|
|
|
|
#include "gtkshortcutmanager.h"
|
2018-08-05 02:10:11 +00:00
|
|
|
|
#include "gtkshortcuttrigger.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtksnapshot.h"
|
2011-01-04 19:51:19 +00:00
|
|
|
|
#include "gtktypebuiltins.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include "gtkwidgetprivate.h"
|
|
|
|
|
#include "gtkwindowgroup.h"
|
2019-12-27 13:45:21 +00:00
|
|
|
|
#include "gtkpopovermenubarprivate.h"
|
2020-01-24 06:55:17 +00:00
|
|
|
|
#include "gtkcssboxesimplprivate.h"
|
2020-05-06 17:56:27 +00:00
|
|
|
|
#include "gtktooltipprivate.h"
|
2018-02-08 23:42:38 +00:00
|
|
|
|
|
2014-05-15 01:23:44 +00:00
|
|
|
|
#include "inspector/window.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2018-03-18 03:38:49 +00:00
|
|
|
|
#include "gdk/gdktextureprivate.h"
|
2014-11-07 14:33:53 +00:00
|
|
|
|
#include "gdk/gdk-private.h"
|
2020-01-22 04:43:01 +00:00
|
|
|
|
#include "gdk/gdkprofilerprivate.h"
|
2014-11-07 14:33:53 +00:00
|
|
|
|
|
2018-02-08 23:42:38 +00:00
|
|
|
|
#include <cairo-gobject.h>
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <graphene.h>
|
|
|
|
|
#include <limits.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
2005-02-21 03:38:31 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
|
|
|
|
#include "x11/gdkx.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-11-27 10:14:16 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_WIN32
|
|
|
|
|
#include "win32/gdkwin32.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-04-11 16:55:54 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_WAYLAND
|
|
|
|
|
#include "wayland/gdkwayland.h"
|
2020-10-12 15:44:05 +00:00
|
|
|
|
#include "wayland/gdkdisplay-wayland.h"
|
2020-10-12 15:40:19 +00:00
|
|
|
|
#include "wayland/gdksurface-wayland.h"
|
2012-04-11 16:55:54 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2013-11-06 12:28:52 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_BROADWAY
|
|
|
|
|
#include "broadway/gdkbroadway.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2010-06-08 23:44:56 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* GtkWindow:
|
|
|
|
|
*
|
|
|
|
|
* A `GtkWindow` is a toplevel window which can contain other widgets.
|
|
|
|
|
*
|
|
|
|
|
* ![An example GtkWindow](window.png)
|
2010-06-08 23:44:56 +00:00
|
|
|
|
*
|
2010-10-08 05:43:03 +00:00
|
|
|
|
* Windows normally have decorations that are under the control
|
|
|
|
|
* of the windowing system and allow the user to manipulate the window
|
|
|
|
|
* (resize it, move it, close it,...).
|
|
|
|
|
*
|
2014-02-05 02:00:58 +00:00
|
|
|
|
* # GtkWindow as GtkBuildable
|
2014-02-02 05:29:00 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* The `GtkWindow` implementation of the [iface@Gtk.Buildable] interface supports
|
2014-02-09 22:24:06 +00:00
|
|
|
|
* setting a child as the titlebar by specifying “titlebar” as the “type”
|
|
|
|
|
* attribute of a <child> element.
|
2015-11-05 21:13:06 +00:00
|
|
|
|
*
|
|
|
|
|
* # CSS nodes
|
|
|
|
|
*
|
2021-02-28 01:07:49 +00:00
|
|
|
|
* ```
|
2021-02-14 16:22:44 +00:00
|
|
|
|
* window.background [.csd / .solid-csd / .ssd] [.maximized / .fullscreen / .tiled]
|
2020-08-01 07:30:48 +00:00
|
|
|
|
* ├── <child>
|
|
|
|
|
* ╰── <titlebar child>.titlebar [.default-decoration]
|
2021-02-28 01:07:49 +00:00
|
|
|
|
* ```
|
2015-11-05 21:13:06 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* `GtkWindow` has a main CSS node with name window and style class .background.
|
2016-01-17 17:13:59 +00:00
|
|
|
|
*
|
|
|
|
|
* Style classes that are typically used with the main CSS node are .csd (when
|
|
|
|
|
* client-side decorations are in use), .solid-csd (for client-side decorations
|
|
|
|
|
* without invisible borders), .ssd (used by mutter when rendering server-side
|
|
|
|
|
* decorations). GtkWindow also represents window states with the following
|
2021-02-14 16:22:44 +00:00
|
|
|
|
* style classes on the main node: .maximized, .fullscreen, .tiled (when supported,
|
|
|
|
|
* also .tiled-top, .tiled-left, .tiled-right, .tiled-bottom).
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* `GtkWindow` subclasses often add their own discriminating style classes,
|
2021-02-14 16:22:44 +00:00
|
|
|
|
* such as .dialog, .popup or .tooltip.
|
2015-11-05 21:13:06 +00:00
|
|
|
|
*
|
2020-05-20 07:36:21 +00:00
|
|
|
|
* Generally, some CSS properties don't make sense on the toplevel window node,
|
|
|
|
|
* such as margins or padding. When client-side decorations without invisible
|
|
|
|
|
* borders are in use (i.e. the .solid-csd style class is added to the
|
|
|
|
|
* main window node), the CSS border of the toplevel window is used for
|
|
|
|
|
* resize drags. In the .csd case, the shadow area outside of the window
|
|
|
|
|
* can be used to resize it.
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* `GtkWindow` adds the .titlebar and .default-decoration style classes to the
|
2015-11-05 21:13:06 +00:00
|
|
|
|
* widget that is added as a titlebar child.
|
2020-07-27 22:25:37 +00:00
|
|
|
|
*
|
|
|
|
|
* # Accessibility
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* `GtkWindow` uses the %GTK_ACCESSIBLE_ROLE_WINDOW role.
|
2010-06-08 23:44:56 +00:00
|
|
|
|
*/
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
2018-08-15 04:43:31 +00:00
|
|
|
|
#define MENU_BAR_ACCEL GDK_KEY_F10
|
2016-10-15 19:55:38 +00:00
|
|
|
|
#define RESIZE_HANDLE_SIZE 20
|
2013-04-02 19:56:31 +00:00
|
|
|
|
#define MNEMONICS_DELAY 300 /* ms */
|
2020-05-05 14:37:10 +00:00
|
|
|
|
#define NO_CONTENT_CHILD_NAT 200 /* ms */
|
|
|
|
|
#define VISIBLE_FOCUS_DURATION 3 /* s */
|
|
|
|
|
|
|
|
|
|
|
2015-06-22 18:36:50 +00:00
|
|
|
|
/* In case the content (excluding header bar and shadows) of the window
|
|
|
|
|
* would be empty, either because there is no visible child widget or only an
|
|
|
|
|
* empty container widget, we use NO_CONTENT_CHILD_NAT as natural width/height
|
|
|
|
|
* instead.
|
|
|
|
|
*/
|
2012-08-20 23:28:25 +00:00
|
|
|
|
|
2020-12-30 07:32:27 +00:00
|
|
|
|
typedef struct _GtkWindowGeometryInfo GtkWindowGeometryInfo;
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
typedef struct
|
2010-08-17 13:37:57 +00:00
|
|
|
|
{
|
2020-05-02 19:17:20 +00:00
|
|
|
|
GtkWidget *child;
|
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
GtkWidget *default_widget;
|
|
|
|
|
GtkWidget *focus_widget;
|
|
|
|
|
GtkWindow *transient_parent;
|
|
|
|
|
GtkWindowGeometryInfo *geometry_info;
|
|
|
|
|
GtkWindowGroup *group;
|
2016-04-11 03:01:10 +00:00
|
|
|
|
GdkDisplay *display;
|
2011-04-11 22:33:43 +00:00
|
|
|
|
GtkApplication *application;
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
2020-12-05 10:44:51 +00:00
|
|
|
|
int default_width;
|
|
|
|
|
int default_height;
|
|
|
|
|
|
2020-07-24 18:40:36 +00:00
|
|
|
|
char *startup_id;
|
|
|
|
|
char *title;
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
|
|
|
|
guint keys_changed_handler;
|
|
|
|
|
|
2011-04-12 17:03:38 +00:00
|
|
|
|
guint32 initial_timestamp;
|
|
|
|
|
|
2013-04-02 19:56:31 +00:00
|
|
|
|
guint mnemonics_display_timeout_id;
|
2012-08-20 23:28:25 +00:00
|
|
|
|
|
2020-04-21 22:14:40 +00:00
|
|
|
|
guint focus_visible_timeout;
|
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int scale;
|
2013-06-28 08:39:52 +00:00
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int title_height;
|
2012-04-11 16:55:54 +00:00
|
|
|
|
GtkWidget *title_box;
|
2013-08-21 18:59:44 +00:00
|
|
|
|
GtkWidget *titlebar;
|
2020-04-21 22:14:40 +00:00
|
|
|
|
GtkWidget *key_press_focus;
|
2012-04-11 16:55:54 +00:00
|
|
|
|
|
2017-11-01 15:52:56 +00:00
|
|
|
|
GdkMonitor *initial_fullscreen_monitor;
|
2017-08-17 03:30:31 +00:00
|
|
|
|
guint edge_constraints;
|
2013-03-24 01:06:14 +00:00
|
|
|
|
|
2020-09-10 04:39:03 +00:00
|
|
|
|
GdkToplevelState state;
|
2017-12-15 02:07:39 +00:00
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
/* The following flags are initially TRUE (before a window is mapped).
|
|
|
|
|
* They cause us to compute a configure request that involves
|
|
|
|
|
* default-only parameters. Once mapped, we set them to FALSE.
|
|
|
|
|
* Then we set them to TRUE again on unmap (for position)
|
|
|
|
|
* and on unrealize (for size).
|
|
|
|
|
*/
|
2013-05-11 22:45:27 +00:00
|
|
|
|
guint need_default_size : 1;
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
|
|
|
|
guint builder_visible : 1;
|
|
|
|
|
guint decorated : 1;
|
|
|
|
|
guint deletable : 1;
|
|
|
|
|
guint destroy_with_parent : 1;
|
2019-11-16 19:50:57 +00:00
|
|
|
|
guint minimize_initially : 1;
|
2010-08-17 13:37:57 +00:00
|
|
|
|
guint is_active : 1;
|
|
|
|
|
guint mnemonics_visible : 1;
|
2011-08-10 14:00:38 +00:00
|
|
|
|
guint focus_visible : 1;
|
2010-08-17 13:37:57 +00:00
|
|
|
|
guint modal : 1;
|
|
|
|
|
guint resizable : 1;
|
|
|
|
|
guint transient_parent_group : 1;
|
2014-06-06 21:59:38 +00:00
|
|
|
|
guint csd_requested : 1;
|
2012-04-11 16:55:54 +00:00
|
|
|
|
guint client_decorated : 1; /* Decorations drawn client-side */
|
2015-03-11 12:52:21 +00:00
|
|
|
|
guint use_client_shadow : 1; /* Decorations use client-side shadows */
|
2013-10-06 04:41:27 +00:00
|
|
|
|
guint maximized : 1;
|
2013-01-31 17:24:31 +00:00
|
|
|
|
guint fullscreen : 1;
|
2013-05-26 05:05:25 +00:00
|
|
|
|
guint tiled : 1;
|
2010-10-13 13:51:54 +00:00
|
|
|
|
|
2017-12-31 15:42:10 +00:00
|
|
|
|
guint hide_on_close : 1;
|
2018-01-18 14:10:49 +00:00
|
|
|
|
guint in_emit_close_request : 1;
|
2021-01-30 02:41:16 +00:00
|
|
|
|
guint move_focus : 1;
|
|
|
|
|
guint unset_default : 1;
|
|
|
|
|
|
2014-08-21 15:34:09 +00:00
|
|
|
|
|
2019-05-29 17:10:46 +00:00
|
|
|
|
GtkGesture *click_gesture;
|
2018-08-22 23:23:24 +00:00
|
|
|
|
GtkEventController *application_shortcut_controller;
|
2014-08-28 12:40:42 +00:00
|
|
|
|
|
2019-05-26 17:43:46 +00:00
|
|
|
|
GdkSurface *surface;
|
2016-06-23 16:34:38 +00:00
|
|
|
|
GskRenderer *renderer;
|
2017-03-31 15:31:20 +00:00
|
|
|
|
|
|
|
|
|
GList *foci;
|
2019-04-09 13:22:19 +00:00
|
|
|
|
|
|
|
|
|
GtkConstraintSolver *constraint_solver;
|
2020-04-10 18:35:02 +00:00
|
|
|
|
|
2020-12-02 10:59:23 +00:00
|
|
|
|
int surface_width;
|
|
|
|
|
int surface_height;
|
|
|
|
|
|
2020-04-10 18:35:02 +00:00
|
|
|
|
GdkCursor *resize_cursor;
|
2021-03-14 23:37:11 +00:00
|
|
|
|
|
|
|
|
|
GtkEventController *menubar_controller;
|
2018-06-18 19:50:33 +00:00
|
|
|
|
} GtkWindowPrivate;
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
enum {
|
1997-12-18 02:17:14 +00:00
|
|
|
|
SET_FOCUS,
|
2001-04-18 22:21:45 +00:00
|
|
|
|
ACTIVATE_FOCUS,
|
|
|
|
|
ACTIVATE_DEFAULT,
|
2001-11-20 23:43:03 +00:00
|
|
|
|
KEYS_CHANGED,
|
2014-07-06 20:53:37 +00:00
|
|
|
|
ENABLE_DEBUGGING,
|
2018-01-01 20:24:16 +00:00
|
|
|
|
CLOSE_REQUEST,
|
1997-11-24 22:37:52 +00:00
|
|
|
|
LAST_SIGNAL
|
|
|
|
|
};
|
2001-01-08 17:04:17 +00:00
|
|
|
|
|
1998-01-16 00:49:51 +00:00
|
|
|
|
enum {
|
2001-03-12 21:01:53 +00:00
|
|
|
|
PROP_0,
|
|
|
|
|
|
2001-08-29 02:20:02 +00:00
|
|
|
|
/* Normal Props */
|
2001-03-12 21:01:53 +00:00
|
|
|
|
PROP_TITLE,
|
2001-06-26 19:23:46 +00:00
|
|
|
|
PROP_RESIZABLE,
|
2001-03-12 21:01:53 +00:00
|
|
|
|
PROP_MODAL,
|
|
|
|
|
PROP_DEFAULT_WIDTH,
|
|
|
|
|
PROP_DEFAULT_HEIGHT,
|
|
|
|
|
PROP_DESTROY_WITH_PARENT,
|
2017-12-31 15:42:10 +00:00
|
|
|
|
PROP_HIDE_ON_CLOSE,
|
2004-07-17 03:55:07 +00:00
|
|
|
|
PROP_ICON_NAME,
|
2017-10-31 06:41:15 +00:00
|
|
|
|
PROP_DISPLAY,
|
2003-07-18 22:00:20 +00:00
|
|
|
|
PROP_DECORATED,
|
2005-08-30 04:46:09 +00:00
|
|
|
|
PROP_DELETABLE,
|
2006-05-12 09:47:58 +00:00
|
|
|
|
PROP_TRANSIENT_FOR,
|
2010-08-11 05:23:23 +00:00
|
|
|
|
PROP_APPLICATION,
|
2019-04-28 16:45:22 +00:00
|
|
|
|
PROP_DEFAULT_WIDGET,
|
2020-03-29 19:19:23 +00:00
|
|
|
|
PROP_FOCUS_WIDGET,
|
2020-05-02 15:33:10 +00:00
|
|
|
|
PROP_CHILD,
|
2021-03-14 23:37:11 +00:00
|
|
|
|
PROP_HANDLE_MENUBAR_ACCEL,
|
2019-04-28 16:45:22 +00:00
|
|
|
|
|
2002-06-06 15:38:39 +00:00
|
|
|
|
/* Readonly properties */
|
|
|
|
|
PROP_IS_ACTIVE,
|
2011-08-10 14:00:38 +00:00
|
|
|
|
|
2007-03-13 17:03:54 +00:00
|
|
|
|
/* Writeonly properties */
|
|
|
|
|
PROP_STARTUP_ID,
|
2011-08-10 14:00:38 +00:00
|
|
|
|
|
2009-12-20 08:04:52 +00:00
|
|
|
|
PROP_MNEMONICS_VISIBLE,
|
2011-08-10 14:00:38 +00:00
|
|
|
|
PROP_FOCUS_VISIBLE,
|
2009-12-20 08:04:52 +00:00
|
|
|
|
|
2020-12-05 11:11:25 +00:00
|
|
|
|
PROP_MAXIMIZED,
|
2020-12-09 00:11:49 +00:00
|
|
|
|
PROP_FULLSCREENED,
|
2013-04-24 19:45:49 +00:00
|
|
|
|
|
2001-03-12 21:01:53 +00:00
|
|
|
|
LAST_ARG
|
1998-01-16 00:49:51 +00:00
|
|
|
|
};
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2015-09-05 05:27:52 +00:00
|
|
|
|
static GParamSpec *window_props[LAST_ARG] = { NULL, };
|
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
/* Must be kept in sync with GdkSurfaceEdge ! */
|
2013-03-10 06:11:18 +00:00
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
GTK_WINDOW_REGION_EDGE_NW,
|
|
|
|
|
GTK_WINDOW_REGION_EDGE_N,
|
|
|
|
|
GTK_WINDOW_REGION_EDGE_NE,
|
|
|
|
|
GTK_WINDOW_REGION_EDGE_W,
|
|
|
|
|
GTK_WINDOW_REGION_EDGE_E,
|
|
|
|
|
GTK_WINDOW_REGION_EDGE_SW,
|
|
|
|
|
GTK_WINDOW_REGION_EDGE_S,
|
|
|
|
|
GTK_WINDOW_REGION_EDGE_SE,
|
|
|
|
|
GTK_WINDOW_REGION_CONTENT,
|
|
|
|
|
} GtkWindowRegion;
|
|
|
|
|
|
2001-08-29 02:20:02 +00:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2020-07-24 18:40:36 +00:00
|
|
|
|
char *icon_name;
|
2001-08-29 02:20:02 +00:00
|
|
|
|
guint realized : 1;
|
|
|
|
|
guint using_default_icon : 1;
|
2004-07-17 03:55:07 +00:00
|
|
|
|
guint using_themed_icon : 1;
|
2001-08-29 02:20:02 +00:00
|
|
|
|
} GtkWindowIconInfo;
|
|
|
|
|
|
1998-12-07 06:37:27 +00:00
|
|
|
|
typedef struct {
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
GdkGeometry geometry; /* Last set of geometry hints we set */
|
2018-03-20 10:40:08 +00:00
|
|
|
|
GdkSurfaceHints flags;
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
GdkRectangle configure_request;
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
} GtkWindowLastGeometryInfo;
|
|
|
|
|
|
2001-04-01 04:05:42 +00:00
|
|
|
|
struct _GtkWindowGeometryInfo
|
|
|
|
|
{
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
GtkWindowLastGeometryInfo last;
|
2001-04-01 04:05:42 +00:00
|
|
|
|
};
|
1998-12-07 06:37:27 +00:00
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
static void gtk_window_constructed (GObject *object);
|
2001-07-02 05:03:21 +00:00
|
|
|
|
static void gtk_window_dispose (GObject *object);
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
static void gtk_window_finalize (GObject *object);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void gtk_window_show (GtkWidget *widget);
|
|
|
|
|
static void gtk_window_hide (GtkWidget *widget);
|
|
|
|
|
static void gtk_window_map (GtkWidget *widget);
|
|
|
|
|
static void gtk_window_unmap (GtkWidget *widget);
|
|
|
|
|
static void gtk_window_realize (GtkWidget *widget);
|
2001-01-08 17:04:17 +00:00
|
|
|
|
static void gtk_window_unrealize (GtkWidget *widget);
|
2018-08-16 04:53:03 +00:00
|
|
|
|
static void gtk_window_size_allocate (GtkWidget *widget,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
2018-03-31 19:02:28 +00:00
|
|
|
|
int baseline);
|
2018-01-01 20:24:16 +00:00
|
|
|
|
static gboolean gtk_window_close_request (GtkWindow *window);
|
2020-04-15 18:43:00 +00:00
|
|
|
|
static gboolean gtk_window_handle_focus (GtkWidget *widget,
|
|
|
|
|
GdkEvent *event,
|
|
|
|
|
double x,
|
|
|
|
|
double y);
|
2019-06-21 02:55:27 +00:00
|
|
|
|
static gboolean gtk_window_key_pressed (GtkWidget *widget,
|
2019-06-21 02:22:26 +00:00
|
|
|
|
guint keyval,
|
|
|
|
|
guint keycode,
|
|
|
|
|
GdkModifierType state,
|
|
|
|
|
gpointer data);
|
|
|
|
|
static gboolean gtk_window_key_released (GtkWidget *widget,
|
|
|
|
|
guint keyval,
|
|
|
|
|
guint keycode,
|
|
|
|
|
GdkModifierType state,
|
|
|
|
|
gpointer data);
|
2019-04-19 20:14:09 +00:00
|
|
|
|
|
|
|
|
|
static void surface_state_changed (GtkWidget *widget);
|
|
|
|
|
static void surface_size_changed (GtkWidget *widget,
|
|
|
|
|
int width,
|
|
|
|
|
int height);
|
|
|
|
|
static gboolean surface_render (GdkSurface *surface,
|
|
|
|
|
cairo_region_t *region,
|
|
|
|
|
GtkWidget *widget);
|
|
|
|
|
static gboolean surface_event (GdkSurface *surface,
|
|
|
|
|
GdkEvent *event,
|
|
|
|
|
GtkWidget *widget);
|
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
|
static int gtk_window_focus (GtkWidget *widget,
|
2000-12-11 17:47:24 +00:00
|
|
|
|
GtkDirectionType direction);
|
2010-10-20 14:58:18 +00:00
|
|
|
|
static void gtk_window_move_focus (GtkWidget *widget,
|
|
|
|
|
GtkDirectionType dir);
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
|
2020-12-05 10:44:51 +00:00
|
|
|
|
static void gtk_window_get_remembered_size (GtkWindow *window,
|
|
|
|
|
int *width,
|
|
|
|
|
int *height);
|
|
|
|
|
|
2001-04-18 22:21:45 +00:00
|
|
|
|
static void gtk_window_real_activate_default (GtkWindow *window);
|
2019-05-12 18:00:19 +00:00
|
|
|
|
static void gtk_window_real_activate_focus (GtkWindow *window);
|
2002-02-21 17:14:10 +00:00
|
|
|
|
static void gtk_window_keys_changed (GtkWindow *window);
|
2014-09-26 13:37:28 +00:00
|
|
|
|
static gboolean gtk_window_enable_debugging (GtkWindow *window,
|
2014-07-06 20:53:37 +00:00
|
|
|
|
gboolean toggle);
|
1998-12-07 06:37:27 +00:00
|
|
|
|
static void gtk_window_unset_transient_for (GtkWindow *window);
|
|
|
|
|
static void gtk_window_transient_parent_realized (GtkWidget *parent,
|
|
|
|
|
GtkWidget *window);
|
|
|
|
|
static void gtk_window_transient_parent_unrealized (GtkWidget *parent,
|
|
|
|
|
GtkWidget *window);
|
|
|
|
|
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
static GtkWindowGeometryInfo* gtk_window_get_geometry_info (GtkWindow *window,
|
|
|
|
|
gboolean create);
|
|
|
|
|
|
|
|
|
|
static void gtk_window_set_default_size_internal (GtkWindow *window,
|
|
|
|
|
gboolean change_width,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int width,
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
gboolean change_height,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int height);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2015-12-02 02:28:36 +00:00
|
|
|
|
static void update_themed_icon (GtkWindow *window);
|
2015-09-11 13:09:10 +00:00
|
|
|
|
static GList *icon_list_from_theme (GtkWindow *window,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *name);
|
2001-08-29 02:20:02 +00:00
|
|
|
|
static void gtk_window_realize_icon (GtkWindow *window);
|
|
|
|
|
static void gtk_window_unrealize_icon (GtkWindow *window);
|
2020-04-22 17:32:10 +00:00
|
|
|
|
static void update_window_actions (GtkWindow *window);
|
2015-09-11 13:09:10 +00:00
|
|
|
|
static void get_shadow_width (GtkWindow *window,
|
2014-02-22 19:07:48 +00:00
|
|
|
|
GtkBorder *shadow_width);
|
2002-02-21 17:14:10 +00:00
|
|
|
|
|
2018-08-15 04:43:31 +00:00
|
|
|
|
static gboolean gtk_window_activate_menubar (GtkWidget *widget,
|
|
|
|
|
GVariant *args,
|
|
|
|
|
gpointer unused);
|
2012-04-16 15:26:19 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
2011-03-20 13:37:27 +00:00
|
|
|
|
static void gtk_window_on_theme_variant_changed (GtkSettings *settings,
|
|
|
|
|
GParamSpec *pspec,
|
|
|
|
|
GtkWindow *window);
|
2012-04-16 15:26:19 +00:00
|
|
|
|
#endif
|
2011-03-20 13:37:27 +00:00
|
|
|
|
static void gtk_window_set_theme_variant (GtkWindow *window);
|
2001-01-08 17:04:17 +00:00
|
|
|
|
|
2019-06-15 01:43:20 +00:00
|
|
|
|
static void gtk_window_activate_default_activate (GtkWidget *widget,
|
|
|
|
|
const char *action_name,
|
|
|
|
|
GVariant *parameter);
|
2020-04-22 17:32:10 +00:00
|
|
|
|
static void gtk_window_activate_minimize (GtkWidget *widget,
|
|
|
|
|
const char *action_name,
|
|
|
|
|
GVariant *parameter);
|
|
|
|
|
static void gtk_window_activate_toggle_maximized (GtkWidget *widget,
|
|
|
|
|
const char *name,
|
|
|
|
|
GVariant *parameter);
|
|
|
|
|
static void gtk_window_activate_close (GtkWidget *widget,
|
|
|
|
|
const char *action_name,
|
|
|
|
|
GVariant *parameter);
|
2019-06-15 01:43:20 +00:00
|
|
|
|
|
2020-02-05 01:46:13 +00:00
|
|
|
|
static void gtk_window_css_changed (GtkWidget *widget,
|
|
|
|
|
GtkCssStyleChange *change);
|
2019-05-04 15:06:40 +00:00
|
|
|
|
static void _gtk_window_set_is_active (GtkWindow *window,
|
|
|
|
|
gboolean is_active);
|
2020-02-29 11:53:24 +00:00
|
|
|
|
static void gtk_window_present_toplevel (GtkWindow *window);
|
2020-12-16 10:53:19 +00:00
|
|
|
|
static void gtk_window_update_toplevel (GtkWindow *window,
|
|
|
|
|
GdkToplevelLayout *layout);
|
2012-04-11 16:55:54 +00:00
|
|
|
|
|
2020-05-05 20:51:24 +00:00
|
|
|
|
static void gtk_window_release_application (GtkWindow *window);
|
|
|
|
|
|
2018-08-27 06:37:16 +00:00
|
|
|
|
static GListStore *toplevel_list = NULL;
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
static guint window_signals[LAST_SIGNAL] = { 0 };
|
2020-07-24 18:40:36 +00:00
|
|
|
|
static char *default_icon_name = NULL;
|
2002-11-02 05:37:04 +00:00
|
|
|
|
static gboolean disable_startup_notification = FALSE;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2006-01-04 07:06:12 +00:00
|
|
|
|
static GQuark quark_gtk_window_icon_info = 0;
|
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
static GtkBuildableIface *parent_buildable_iface;
|
|
|
|
|
|
2001-03-12 21:01:53 +00:00
|
|
|
|
static void gtk_window_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
|
|
|
|
static void gtk_window_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
/* GtkBuildable */
|
2019-08-29 13:21:20 +00:00
|
|
|
|
static void gtk_window_buildable_interface_init (GtkBuildableIface *iface);
|
|
|
|
|
static void gtk_window_buildable_add_child (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *type);
|
2019-08-29 13:21:20 +00:00
|
|
|
|
static void gtk_window_buildable_set_buildable_property (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *name,
|
2019-08-29 13:21:20 +00:00
|
|
|
|
const GValue *value);
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
|
2020-02-06 15:43:55 +00:00
|
|
|
|
static void gtk_window_shortcut_manager_interface_init (GtkShortcutManagerInterface *iface);
|
2018-04-06 18:30:34 +00:00
|
|
|
|
/* GtkRoot */
|
2019-05-26 17:43:46 +00:00
|
|
|
|
static void gtk_window_root_interface_init (GtkRootInterface *iface);
|
|
|
|
|
static void gtk_window_native_interface_init (GtkNativeInterface *iface);
|
2018-04-06 18:30:34 +00:00
|
|
|
|
|
2012-01-05 17:21:03 +00:00
|
|
|
|
static void ensure_state_flag_backdrop (GtkWidget *widget);
|
2013-05-13 00:58:48 +00:00
|
|
|
|
static void unset_titlebar (GtkWindow *window);
|
2014-03-28 14:44:11 +00:00
|
|
|
|
|
2020-12-02 10:59:23 +00:00
|
|
|
|
#define INCLUDE_CSD_SIZE 1
|
|
|
|
|
#define EXCLUDE_CSD_SIZE -1
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_window_update_csd_size (GtkWindow *window,
|
|
|
|
|
int *width,
|
|
|
|
|
int *height,
|
|
|
|
|
int apply);
|
2011-10-28 22:45:38 +00:00
|
|
|
|
|
2020-05-02 19:17:20 +00:00
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GtkWindow, gtk_window, GTK_TYPE_WIDGET,
|
2013-06-27 19:02:52 +00:00
|
|
|
|
G_ADD_PRIVATE (GtkWindow)
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
2018-04-06 18:30:34 +00:00
|
|
|
|
gtk_window_buildable_interface_init)
|
2019-05-26 17:43:46 +00:00
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_NATIVE,
|
|
|
|
|
gtk_window_native_interface_init)
|
2020-02-06 15:43:55 +00:00
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_SHORTCUT_MANAGER,
|
|
|
|
|
gtk_window_shortcut_manager_interface_init)
|
2018-04-06 18:30:34 +00:00
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_ROOT,
|
|
|
|
|
gtk_window_root_interface_init))
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2002-01-29 19:44:49 +00:00
|
|
|
|
static void
|
2018-08-04 10:30:53 +00:00
|
|
|
|
add_tab_bindings (GtkWidgetClass *widget_class,
|
2002-01-29 19:44:49 +00:00
|
|
|
|
GdkModifierType modifiers,
|
|
|
|
|
GtkDirectionType direction)
|
|
|
|
|
{
|
2018-08-05 02:10:11 +00:00
|
|
|
|
GtkShortcut *shortcut;
|
|
|
|
|
|
2018-08-18 18:01:43 +00:00
|
|
|
|
shortcut = gtk_shortcut_new_with_arguments (
|
|
|
|
|
gtk_alternative_trigger_new (gtk_keyval_trigger_new (GDK_KEY_Tab, modifiers),
|
|
|
|
|
gtk_keyval_trigger_new (GDK_KEY_KP_Tab, modifiers)),
|
|
|
|
|
gtk_signal_action_new ("move-focus"),
|
|
|
|
|
"(i)", direction);
|
2018-08-05 02:10:11 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_class_add_shortcut (widget_class, shortcut);
|
|
|
|
|
|
|
|
|
|
g_object_unref (shortcut);
|
2002-01-29 19:44:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-02-08 00:02:52 +00:00
|
|
|
|
static void
|
2018-08-04 10:30:53 +00:00
|
|
|
|
add_arrow_bindings (GtkWidgetClass *widget_class,
|
2002-02-08 00:02:52 +00:00
|
|
|
|
guint keysym,
|
|
|
|
|
GtkDirectionType direction)
|
|
|
|
|
{
|
2010-09-08 17:35:51 +00:00
|
|
|
|
guint keypad_keysym = keysym - GDK_KEY_Left + GDK_KEY_KP_Left;
|
2002-02-08 00:02:52 +00:00
|
|
|
|
|
2018-08-04 10:30:53 +00:00
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class, keysym, 0,
|
|
|
|
|
"move-focus",
|
|
|
|
|
"(i)",
|
|
|
|
|
direction);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class, keysym, GDK_CONTROL_MASK,
|
|
|
|
|
"move-focus",
|
|
|
|
|
"(i)",
|
|
|
|
|
direction);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class, keypad_keysym, 0,
|
|
|
|
|
"move-focus",
|
|
|
|
|
"(i)",
|
|
|
|
|
direction);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class, keypad_keysym, GDK_CONTROL_MASK,
|
|
|
|
|
"move-focus",
|
|
|
|
|
"(i)",
|
|
|
|
|
direction);
|
2002-02-08 00:02:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-03-13 17:03:54 +00:00
|
|
|
|
static guint32
|
2020-07-24 18:40:36 +00:00
|
|
|
|
extract_time_from_startup_id (const char * startup_id)
|
2007-03-13 17:03:54 +00:00
|
|
|
|
{
|
2020-07-24 18:40:36 +00:00
|
|
|
|
char *timestr = g_strrstr (startup_id, "_TIME");
|
2007-03-13 17:03:54 +00:00
|
|
|
|
guint32 retval = GDK_CURRENT_TIME;
|
|
|
|
|
|
|
|
|
|
if (timestr)
|
|
|
|
|
{
|
2020-07-24 18:40:36 +00:00
|
|
|
|
char *end;
|
2007-03-13 17:03:54 +00:00
|
|
|
|
guint32 timestamp;
|
|
|
|
|
|
|
|
|
|
/* Skip past the "_TIME" part */
|
|
|
|
|
timestr += 5;
|
2009-04-07 13:32:16 +00:00
|
|
|
|
|
2010-10-25 16:22:20 +00:00
|
|
|
|
end = NULL;
|
2009-04-07 13:32:16 +00:00
|
|
|
|
errno = 0;
|
2010-10-25 16:22:20 +00:00
|
|
|
|
timestamp = g_ascii_strtoull (timestr, &end, 0);
|
|
|
|
|
if (errno == 0 && end != timestr)
|
2007-03-13 17:03:54 +00:00
|
|
|
|
retval = timestamp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
2020-07-24 18:40:36 +00:00
|
|
|
|
startup_id_is_fake (const char * startup_id)
|
2007-03-13 17:03:54 +00:00
|
|
|
|
{
|
|
|
|
|
return strncmp (startup_id, "_TIME", 5) == 0;
|
|
|
|
|
}
|
2002-02-08 00:02:52 +00:00
|
|
|
|
|
2016-10-22 14:06:14 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_measure (GtkWidget *widget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline)
|
|
|
|
|
{
|
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-05-02 19:17:20 +00:00
|
|
|
|
GtkWidget *child = priv->child;
|
2016-10-22 14:06:14 +00:00
|
|
|
|
gboolean has_size_request = gtk_widget_has_size_request (widget);
|
|
|
|
|
int title_min_size = 0;
|
|
|
|
|
int title_nat_size = 0;
|
|
|
|
|
int child_min_size = 0;
|
|
|
|
|
int child_nat_size = 0;
|
|
|
|
|
|
|
|
|
|
if (priv->decorated && !priv->fullscreen)
|
|
|
|
|
{
|
|
|
|
|
if (priv->title_box != NULL &&
|
|
|
|
|
gtk_widget_get_visible (priv->title_box) &&
|
|
|
|
|
gtk_widget_get_child_visible (priv->title_box))
|
|
|
|
|
{
|
|
|
|
|
int size = for_size;
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL && for_size >= 0)
|
|
|
|
|
gtk_widget_measure (priv->title_box,
|
2017-03-20 13:59:14 +00:00
|
|
|
|
GTK_ORIENTATION_VERTICAL,
|
2016-10-22 14:06:14 +00:00
|
|
|
|
-1,
|
|
|
|
|
NULL, &size,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
|
|
|
|
|
gtk_widget_measure (priv->title_box,
|
|
|
|
|
orientation,
|
2016-11-12 13:34:53 +00:00
|
|
|
|
MAX (size, -1),
|
2016-10-22 14:06:14 +00:00
|
|
|
|
&title_min_size, &title_nat_size,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (child != NULL && gtk_widget_get_visible (child))
|
|
|
|
|
{
|
|
|
|
|
gtk_widget_measure (child,
|
|
|
|
|
orientation,
|
2016-11-12 13:34:53 +00:00
|
|
|
|
MAX (for_size, -1),
|
2016-10-22 14:06:14 +00:00
|
|
|
|
&child_min_size, &child_nat_size,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (child_nat_size == 0 && !has_size_request)
|
|
|
|
|
child_nat_size = NO_CONTENT_CHILD_NAT;
|
|
|
|
|
}
|
|
|
|
|
else if (!has_size_request)
|
|
|
|
|
{
|
|
|
|
|
child_nat_size = NO_CONTENT_CHILD_NAT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
*minimum = MAX (title_min_size, child_min_size);
|
|
|
|
|
*natural = MAX (title_nat_size, child_nat_size);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-05-02 06:45:19 +00:00
|
|
|
|
*minimum = title_min_size + child_min_size;
|
|
|
|
|
*natural = title_nat_size + child_nat_size;
|
2016-10-22 14:06:14 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-07 18:13:42 +00:00
|
|
|
|
static void
|
2020-05-02 19:17:20 +00:00
|
|
|
|
gtk_window_compute_expand (GtkWidget *widget,
|
|
|
|
|
gboolean *hexpand,
|
|
|
|
|
gboolean *vexpand)
|
2017-04-07 18:13:42 +00:00
|
|
|
|
{
|
2020-05-02 19:17:20 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
if (priv->child)
|
|
|
|
|
{
|
|
|
|
|
*hexpand = gtk_widget_compute_expand (priv->child, GTK_ORIENTATION_HORIZONTAL);
|
|
|
|
|
*vexpand = gtk_widget_compute_expand (priv->child, GTK_ORIENTATION_VERTICAL);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
*hexpand = FALSE;
|
|
|
|
|
*vexpand = FALSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-04-07 18:13:42 +00:00
|
|
|
|
|
2020-05-02 19:17:20 +00:00
|
|
|
|
static GtkSizeRequestMode
|
|
|
|
|
gtk_window_get_request_mode (GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
if (priv->child)
|
|
|
|
|
return gtk_widget_get_request_mode (priv->child);
|
|
|
|
|
else
|
|
|
|
|
return GTK_SIZE_REQUEST_CONSTANT_SIZE;
|
2017-04-07 18:13:42 +00:00
|
|
|
|
}
|
2016-10-22 14:06:14 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_class_init (GtkWindowClass *klass)
|
|
|
|
|
{
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
2018-08-24 06:46:54 +00:00
|
|
|
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
2010-09-18 23:55:42 +00:00
|
|
|
|
|
2006-01-04 07:06:12 +00:00
|
|
|
|
quark_gtk_window_icon_info = g_quark_from_static_string ("gtk-window-icon-info");
|
|
|
|
|
|
2018-08-27 06:37:16 +00:00
|
|
|
|
if (toplevel_list == NULL)
|
|
|
|
|
toplevel_list = g_list_store_new (GTK_TYPE_WIDGET);
|
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
gobject_class->constructed = gtk_window_constructed;
|
2001-07-02 05:03:21 +00:00
|
|
|
|
gobject_class->dispose = gtk_window_dispose;
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
gobject_class->finalize = gtk_window_finalize;
|
|
|
|
|
|
2001-03-12 21:01:53 +00:00
|
|
|
|
gobject_class->set_property = gtk_window_set_property;
|
|
|
|
|
gobject_class->get_property = gtk_window_get_property;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
|
widget_class->show = gtk_window_show;
|
|
|
|
|
widget_class->hide = gtk_window_hide;
|
|
|
|
|
widget_class->map = gtk_window_map;
|
|
|
|
|
widget_class->unmap = gtk_window_unmap;
|
|
|
|
|
widget_class->realize = gtk_window_realize;
|
2001-01-08 17:04:17 +00:00
|
|
|
|
widget_class->unrealize = gtk_window_unrealize;
|
2012-11-14 18:35:47 +00:00
|
|
|
|
widget_class->size_allocate = gtk_window_size_allocate;
|
2020-05-02 19:17:20 +00:00
|
|
|
|
widget_class->compute_expand = gtk_window_compute_expand;
|
|
|
|
|
widget_class->get_request_mode = gtk_window_get_request_mode;
|
2001-06-08 18:09:34 +00:00
|
|
|
|
widget_class->focus = gtk_window_focus;
|
2010-10-20 14:58:18 +00:00
|
|
|
|
widget_class->move_focus = gtk_window_move_focus;
|
2020-05-02 08:25:12 +00:00
|
|
|
|
widget_class->measure = gtk_window_measure;
|
2020-02-05 01:46:13 +00:00
|
|
|
|
widget_class->css_changed = gtk_window_css_changed;
|
2009-12-20 08:04:52 +00:00
|
|
|
|
|
2001-04-18 22:21:45 +00:00
|
|
|
|
klass->activate_default = gtk_window_real_activate_default;
|
2019-05-12 18:00:19 +00:00
|
|
|
|
klass->activate_focus = gtk_window_real_activate_focus;
|
2002-02-21 17:14:10 +00:00
|
|
|
|
klass->keys_changed = gtk_window_keys_changed;
|
2014-07-06 20:53:37 +00:00
|
|
|
|
klass->enable_debugging = gtk_window_enable_debugging;
|
2018-01-01 20:24:16 +00:00
|
|
|
|
klass->close_request = gtk_window_close_request;
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
2021-02-26 04:24:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow:title: (attributes org.gtk.Property.get=gtk_window_get_title org.gtk.Property.set=gtk_window_set_title)
|
|
|
|
|
*
|
|
|
|
|
* The title of the window.
|
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_TITLE] =
|
|
|
|
|
g_param_spec_string ("title",
|
|
|
|
|
P_("Window Title"),
|
|
|
|
|
P_("The title of the window"),
|
|
|
|
|
NULL,
|
|
|
|
|
GTK_PARAM_READWRITE);
|
|
|
|
|
|
2007-03-13 17:03:54 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* GtkWindow:startup-id: (attributes org.gtk.Property.set=gtk_window_set_startup_id)
|
2007-03-13 17:03:54 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* A write-only property for setting window's startup notification identifier.
|
2009-07-20 03:46:53 +00:00
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_STARTUP_ID] =
|
|
|
|
|
g_param_spec_string ("startup-id",
|
|
|
|
|
P_("Startup ID"),
|
|
|
|
|
P_("Unique startup identifier for the window used by startup-notification"),
|
|
|
|
|
NULL,
|
|
|
|
|
GTK_PARAM_WRITABLE);
|
|
|
|
|
|
2021-02-26 04:24:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow:resizable: (attributes org.gtk.Property.get=gtk_window_get_resizable org.gtk.Property.set=gtk_window_set_resizable)
|
|
|
|
|
*
|
|
|
|
|
* If %TRUE, users can resize the window.
|
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_RESIZABLE] =
|
|
|
|
|
g_param_spec_boolean ("resizable",
|
|
|
|
|
P_("Resizable"),
|
|
|
|
|
P_("If TRUE, users can resize the window"),
|
|
|
|
|
TRUE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2021-02-26 04:24:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow:modal: (attributes org.gtk.Property.get=gtk_window_get_modal org.gtk.Property.set=gtk_window_set_modal)
|
|
|
|
|
*
|
|
|
|
|
* If %TRUE, the window is modal.
|
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_MODAL] =
|
|
|
|
|
g_param_spec_boolean ("modal",
|
|
|
|
|
P_("Modal"),
|
|
|
|
|
P_("If TRUE, the window is modal (other windows are not usable while this one is up)"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2021-02-26 04:24:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow:default-width:
|
|
|
|
|
*
|
|
|
|
|
* The default width of the window.
|
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_DEFAULT_WIDTH] =
|
|
|
|
|
g_param_spec_int ("default-width",
|
|
|
|
|
P_("Default Width"),
|
2020-12-05 10:44:51 +00:00
|
|
|
|
P_("The default width of the window"),
|
2015-09-05 05:27:52 +00:00
|
|
|
|
-1, G_MAXINT,
|
2020-12-05 10:44:51 +00:00
|
|
|
|
0,
|
2015-09-05 05:27:52 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2021-02-26 04:24:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow:default-height:
|
|
|
|
|
*
|
|
|
|
|
* The default height of the window.
|
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_DEFAULT_HEIGHT] =
|
|
|
|
|
g_param_spec_int ("default-height",
|
|
|
|
|
P_("Default Height"),
|
2020-12-05 10:44:51 +00:00
|
|
|
|
P_("The default height of the window"),
|
2015-09-05 05:27:52 +00:00
|
|
|
|
-1, G_MAXINT,
|
2020-12-05 10:44:51 +00:00
|
|
|
|
0,
|
2015-09-05 05:27:52 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2021-02-26 04:24:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow:destroy-with-parent: (attributes org.gtk.Property.get=gtk_window_get_destroy_with_parent org.gtk.Property.set=gtk_window_set_destroy_with_parent)
|
|
|
|
|
*
|
|
|
|
|
* If this window should be destroyed when the parent is destroyed.
|
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_DESTROY_WITH_PARENT] =
|
|
|
|
|
g_param_spec_boolean ("destroy-with-parent",
|
|
|
|
|
P_("Destroy with Parent"),
|
|
|
|
|
P_("If this window should be destroyed when the parent is destroyed"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2021-02-26 04:24:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow:hide-on-close: (attributes org.gtk.Property.get=gtk_window_get_hide_on_close org.gtk.Property.set=gtk_window_set_hide_on_close)
|
|
|
|
|
*
|
|
|
|
|
* If this window should be hidden when the users clicks the close button.
|
|
|
|
|
*/
|
2017-12-31 15:42:10 +00:00
|
|
|
|
window_props[PROP_HIDE_ON_CLOSE] =
|
|
|
|
|
g_param_spec_boolean ("hide-on-close",
|
|
|
|
|
P_("Hide on close"),
|
|
|
|
|
P_("If this window should be hidden when the user clicks the close button"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2021-02-26 04:24:31 +00:00
|
|
|
|
|
2011-08-10 14:00:38 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* GtkWindow:mnemonics-visible: (attributes org.gtk.Property.get=gtk_window_get_mnemonics_visible org.gtk.Property.set=gtk_window_set_mnemonics_visible)
|
2011-08-10 14:00:38 +00:00
|
|
|
|
*
|
|
|
|
|
* Whether mnemonics are currently visible in this window.
|
|
|
|
|
*
|
2020-09-12 16:01:04 +00:00
|
|
|
|
* This property is maintained by GTK based on user input,
|
2011-08-10 14:00:38 +00:00
|
|
|
|
* and should not be set by applications.
|
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_MNEMONICS_VISIBLE] =
|
|
|
|
|
g_param_spec_boolean ("mnemonics-visible",
|
|
|
|
|
P_("Mnemonics Visible"),
|
|
|
|
|
P_("Whether mnemonics are currently visible in this window"),
|
2019-06-23 14:55:10 +00:00
|
|
|
|
FALSE,
|
2015-09-05 05:27:52 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2011-08-10 14:00:38 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* GtkWindow:focus-visible: (attributes org.gtk.Property.get=gtk_window_get_focus_visible org.gtk.Property.set=gtk_window_set_focus_visible)
|
2011-08-10 14:00:38 +00:00
|
|
|
|
*
|
|
|
|
|
* Whether 'focus rectangles' are currently visible in this window.
|
|
|
|
|
*
|
2020-09-12 16:01:04 +00:00
|
|
|
|
* This property is maintained by GTK based on user input
|
2011-08-10 14:00:38 +00:00
|
|
|
|
* and should not be set by applications.
|
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_FOCUS_VISIBLE] =
|
|
|
|
|
g_param_spec_boolean ("focus-visible",
|
|
|
|
|
P_("Focus Visible"),
|
|
|
|
|
P_("Whether focus rectangles are currently visible in this window"),
|
|
|
|
|
TRUE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2004-07-17 03:55:07 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* GtkWindow:icon-name: (attributes org.gtk.Property.get=gtk_window_get_icon_name org.gtk.Property.set=gtk_window_set_icon_name)
|
|
|
|
|
*
|
|
|
|
|
* Specifies the name of the themed icon to use as the window icon.
|
2004-07-17 03:55:07 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* See [class@Gtk.IconTheme] for more details.
|
2004-07-17 03:55:07 +00:00
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_ICON_NAME] =
|
|
|
|
|
g_param_spec_string ("icon-name",
|
|
|
|
|
P_("Icon Name"),
|
|
|
|
|
P_("Name of the themed icon for this window"),
|
|
|
|
|
NULL,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2021-02-26 04:24:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow:display: (attributes org.gtk.Property.set=gtk_window_set_display)
|
|
|
|
|
*
|
|
|
|
|
* The display that will display this window.
|
|
|
|
|
*/
|
2017-10-31 06:41:15 +00:00
|
|
|
|
window_props[PROP_DISPLAY] =
|
|
|
|
|
g_param_spec_object ("display",
|
|
|
|
|
P_("Display"),
|
|
|
|
|
P_("The display that will display this window"),
|
|
|
|
|
GDK_TYPE_DISPLAY,
|
2015-09-05 05:27:52 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2021-02-26 04:24:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow:is-active: (attributes org.gtk.Property.get=gtk_window_is_active)
|
|
|
|
|
*
|
|
|
|
|
* Whether the toplevel is the currently active window.
|
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_IS_ACTIVE] =
|
|
|
|
|
g_param_spec_boolean ("is-active",
|
|
|
|
|
P_("Is Active"),
|
|
|
|
|
P_("Whether the toplevel is the current active window"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READABLE);
|
|
|
|
|
|
2003-07-18 22:00:20 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* GtkWindow:decorated: (attributes org.gtk.Property.get=gtk_window_get_decorated org.gtk.Property.set=gtk_window_set_decorated)
|
2003-07-18 22:00:20 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Whether the window should have a frame (also known as *decorations*).
|
2003-07-18 22:00:20 +00:00
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_DECORATED] =
|
|
|
|
|
g_param_spec_boolean ("decorated",
|
|
|
|
|
P_("Decorated"),
|
|
|
|
|
P_("Whether the window should be decorated by the window manager"),
|
|
|
|
|
TRUE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2003-07-18 22:00:20 +00:00
|
|
|
|
|
2005-08-30 04:46:09 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* GtkWindow:deletable: (attributes org.gtk.Property.get=gtk_window_get_deletable org.gtk.Property.set=gtk_window_set_deletable)
|
2005-08-30 04:46:09 +00:00
|
|
|
|
*
|
|
|
|
|
* Whether the window frame should have a close button.
|
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_DELETABLE] =
|
|
|
|
|
g_param_spec_boolean ("deletable",
|
|
|
|
|
P_("Deletable"),
|
|
|
|
|
P_("Whether the window frame should have a close button"),
|
|
|
|
|
TRUE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2005-08-30 04:46:09 +00:00
|
|
|
|
|
2006-05-12 09:47:58 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* GtkWindow:transient-for: (attributes org.gtk.Property.get=gtk_window_get_transient_for org.gtk.Property.set=gtk_window_set_transient_for)
|
2006-05-12 09:47:58 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* The transient parent of the window.
|
2006-05-12 09:47:58 +00:00
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_TRANSIENT_FOR] =
|
|
|
|
|
g_param_spec_object ("transient-for",
|
|
|
|
|
P_("Transient for Window"),
|
|
|
|
|
P_("The transient parent of the dialog"),
|
|
|
|
|
GTK_TYPE_WINDOW,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_CONSTRUCT|G_PARAM_EXPLICIT_NOTIFY);
|
2008-12-29 07:39:34 +00:00
|
|
|
|
|
2020-12-08 23:49:45 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* GtkWindow:maximized: (attributes org.gtk.Property.get=gtk_window_is_maximized)
|
2020-12-08 23:49:45 +00:00
|
|
|
|
*
|
|
|
|
|
* Whether the window is maximized.
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Setting this property is the equivalent of calling
|
|
|
|
|
* [method@Gtk.Window.maximize] or [method@Gtk.Window.unmaximize];
|
|
|
|
|
* either operation is asynchronous, which means you will need to
|
|
|
|
|
* connect to the ::notify signal in order to know whether the
|
|
|
|
|
* operation was successful.
|
2020-12-08 23:49:45 +00:00
|
|
|
|
*/
|
2020-12-05 11:11:25 +00:00
|
|
|
|
window_props[PROP_MAXIMIZED] =
|
|
|
|
|
g_param_spec_boolean ("maximized",
|
2020-12-08 23:49:45 +00:00
|
|
|
|
P_("Is Maximized"),
|
2015-09-05 05:27:52 +00:00
|
|
|
|
P_("Whether the window is maximized"),
|
|
|
|
|
FALSE,
|
2020-12-05 11:11:25 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_CONSTRUCT|G_PARAM_EXPLICIT_NOTIFY);
|
2013-03-10 06:11:18 +00:00
|
|
|
|
|
2020-12-08 23:49:45 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* GtkWindow:fullscreened: (attributes org.gtk.Property.get=gtk_window_is_fullscreen)
|
2020-12-08 23:49:45 +00:00
|
|
|
|
*
|
|
|
|
|
* Whether the window is fullscreen.
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Setting this property is the equivalent of calling
|
|
|
|
|
* [method@Gtk.Window.fullscreen] or [method@Gtk.Window.unfullscreen];
|
|
|
|
|
* either operation is asynchronous, which means you will need to
|
|
|
|
|
* connect to the ::notify signal in order to know whether the
|
|
|
|
|
* operation was successful.
|
2020-12-08 23:49:45 +00:00
|
|
|
|
*/
|
2020-12-09 00:11:49 +00:00
|
|
|
|
window_props[PROP_FULLSCREENED] =
|
|
|
|
|
g_param_spec_boolean ("fullscreened",
|
2020-12-05 11:22:25 +00:00
|
|
|
|
P_("Is fullscreen"),
|
|
|
|
|
P_("Whether the window is fullscreen"),
|
|
|
|
|
FALSE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_CONSTRUCT|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2010-08-11 05:23:23 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* GtkWindow:application: (attributes org.gtk.Property.get=gtk_window_get_application org.gtk.Property.set=gtk_window_set_application)
|
2010-08-11 05:23:23 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* The `GtkApplication` associated with the window.
|
2010-08-11 05:23:23 +00:00
|
|
|
|
*
|
2011-01-25 03:20:35 +00:00
|
|
|
|
* The application will be kept alive for at least as long as it
|
|
|
|
|
* has any windows associated with it (see g_application_hold()
|
|
|
|
|
* for a way to keep it alive without windows).
|
|
|
|
|
*
|
|
|
|
|
* Normally, the connection between the application and the window
|
|
|
|
|
* will remain until the window is destroyed, but you can explicitly
|
2016-04-08 18:13:07 +00:00
|
|
|
|
* remove it by setting the :application property to %NULL.
|
2010-08-11 05:23:23 +00:00
|
|
|
|
*/
|
2015-09-05 05:27:52 +00:00
|
|
|
|
window_props[PROP_APPLICATION] =
|
|
|
|
|
g_param_spec_object ("application",
|
|
|
|
|
P_("GtkApplication"),
|
|
|
|
|
P_("The GtkApplication for the window"),
|
|
|
|
|
GTK_TYPE_APPLICATION,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2021-02-26 04:24:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow:default-widget: (attributes org.gtk.Property.get=gtk_window_get_default_widget org.gtk.Property.set=gtk_window_set_default_widget)
|
|
|
|
|
*
|
|
|
|
|
* The default widget.
|
|
|
|
|
*/
|
2019-04-28 16:45:22 +00:00
|
|
|
|
window_props[PROP_DEFAULT_WIDGET] =
|
|
|
|
|
g_param_spec_object ("default-widget",
|
|
|
|
|
P_("Default widget"),
|
|
|
|
|
P_("The default widget"),
|
|
|
|
|
GTK_TYPE_WIDGET,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2021-02-26 04:24:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow:focus-widget: (attributes org.gtk.Property.get=gtk_window_get_focus org.gtk.Property.set=gtk_window_set_focus)
|
|
|
|
|
*
|
|
|
|
|
* The focus widget.
|
|
|
|
|
*/
|
2020-03-29 19:19:23 +00:00
|
|
|
|
window_props[PROP_FOCUS_WIDGET] =
|
|
|
|
|
g_param_spec_object ("focus-widget",
|
|
|
|
|
P_("Focus widget"),
|
|
|
|
|
P_("The focus widget"),
|
|
|
|
|
GTK_TYPE_WIDGET,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2021-02-26 04:24:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow:child: (attributes org.gtk.Property.get=gtk_window_get_child org.gtk.Property.set=gtk_window_set_child)
|
|
|
|
|
*
|
|
|
|
|
* The child widget.
|
|
|
|
|
*/
|
2020-05-02 15:33:10 +00:00
|
|
|
|
window_props[PROP_CHILD] =
|
|
|
|
|
g_param_spec_object ("child",
|
|
|
|
|
P_("Child"),
|
|
|
|
|
P_("The child widget"),
|
|
|
|
|
GTK_TYPE_WIDGET,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_STATIC_STRINGS|G_PARAM_EXPLICIT_NOTIFY);
|
|
|
|
|
|
2021-03-14 23:37:11 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow:handle-menubar-accel: (attributes org.gtk.Property.get=gtk_window_get_handle_menubar_accel org.gtk.Property.set=gtk_window_set_handle_menubar_accel)
|
|
|
|
|
*
|
|
|
|
|
* Whether the window frame should handle F10 for activating
|
|
|
|
|
* menubars.
|
|
|
|
|
*
|
|
|
|
|
* Since: 4.2
|
|
|
|
|
*/
|
|
|
|
|
window_props[PROP_HANDLE_MENUBAR_ACCEL] =
|
|
|
|
|
g_param_spec_boolean ("handle-menubar-accel",
|
|
|
|
|
P_("Handle Menubar accels"),
|
|
|
|
|
P_("Whether the window should handle F10"),
|
|
|
|
|
TRUE,
|
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
2020-05-02 15:33:10 +00:00
|
|
|
|
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_class_install_properties (gobject_class, LAST_ARG, window_props);
|
|
|
|
|
|
2008-12-29 07:39:34 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow::activate-focus:
|
|
|
|
|
* @window: the window which received the signal
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Emitted when the user activates the currently focused
|
|
|
|
|
* widget of @window.
|
|
|
|
|
*
|
|
|
|
|
* This is a [keybinding signal](class.SignalAction.html).
|
2008-12-29 07:39:34 +00:00
|
|
|
|
*/
|
2001-04-18 22:21:45 +00:00
|
|
|
|
window_signals[ACTIVATE_FOCUS] =
|
2008-08-08 13:44:46 +00:00
|
|
|
|
g_signal_new (I_("activate-focus"),
|
2002-10-01 19:55:08 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
2002-10-01 19:55:08 +00:00
|
|
|
|
G_STRUCT_OFFSET (GtkWindowClass, activate_focus),
|
2001-06-29 16:30:25 +00:00
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_TYPE_NONE,
|
|
|
|
|
0);
|
2001-04-18 22:21:45 +00:00
|
|
|
|
|
2008-12-29 07:39:34 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow::activate-default:
|
|
|
|
|
* @window: the window which received the signal
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Emitted when the user activates the default widget
|
2008-12-29 07:39:34 +00:00
|
|
|
|
* of @window.
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*
|
|
|
|
|
* This is a [keybinding signal](class.SignalAction.html).
|
2008-12-29 07:39:34 +00:00
|
|
|
|
*/
|
2001-04-18 22:21:45 +00:00
|
|
|
|
window_signals[ACTIVATE_DEFAULT] =
|
2008-08-08 13:44:46 +00:00
|
|
|
|
g_signal_new (I_("activate-default"),
|
2002-10-01 19:55:08 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
2002-10-01 19:55:08 +00:00
|
|
|
|
G_STRUCT_OFFSET (GtkWindowClass, activate_default),
|
2001-06-29 16:30:25 +00:00
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
2001-06-29 16:30:25 +00:00
|
|
|
|
G_TYPE_NONE,
|
|
|
|
|
0);
|
2001-04-18 22:21:45 +00:00
|
|
|
|
|
2008-12-29 07:39:34 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow::keys-changed:
|
|
|
|
|
* @window: the window which received the signal
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* emitted when the set of accelerators or mnemonics that
|
|
|
|
|
* are associated with @window changes.
|
2008-12-29 07:39:34 +00:00
|
|
|
|
*/
|
2001-11-20 23:43:03 +00:00
|
|
|
|
window_signals[KEYS_CHANGED] =
|
2008-08-08 13:44:46 +00:00
|
|
|
|
g_signal_new (I_("keys-changed"),
|
2002-10-01 19:55:08 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
2002-10-01 19:55:08 +00:00
|
|
|
|
G_STRUCT_OFFSET (GtkWindowClass, keys_changed),
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
NULL, NULL,
|
2016-08-29 14:00:17 +00:00
|
|
|
|
NULL,
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
G_TYPE_NONE,
|
|
|
|
|
0);
|
2001-04-18 22:21:45 +00:00
|
|
|
|
|
2014-05-07 02:20:10 +00:00
|
|
|
|
/**
|
2014-07-06 20:53:37 +00:00
|
|
|
|
* GtkWindow::enable-debugging:
|
2014-05-07 02:20:10 +00:00
|
|
|
|
* @window: the window on which the signal is emitted
|
2014-07-06 20:53:37 +00:00
|
|
|
|
* @toggle: toggle the debugger
|
2014-05-07 02:20:10 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Emitted when the user enables or disables interactive debugging.
|
|
|
|
|
*
|
|
|
|
|
* When @toggle is %TRUE, interactive debugging is toggled on or off,
|
|
|
|
|
* when it is %FALSE, the debugger will be pointed at the widget
|
|
|
|
|
* under the pointer.
|
|
|
|
|
*
|
|
|
|
|
* This is a [keybinding signal](class.SignalAction.html).
|
2014-05-07 02:20:10 +00:00
|
|
|
|
*
|
2014-07-06 20:53:37 +00:00
|
|
|
|
* The default bindings for this signal are Ctrl-Shift-I
|
|
|
|
|
* and Ctrl-Shift-D.
|
2014-09-26 13:37:28 +00:00
|
|
|
|
*
|
|
|
|
|
* Return: %TRUE if the key binding was handled
|
2014-05-07 02:20:10 +00:00
|
|
|
|
*/
|
2014-07-06 20:53:37 +00:00
|
|
|
|
window_signals[ENABLE_DEBUGGING] =
|
|
|
|
|
g_signal_new (I_("enable-debugging"),
|
2014-05-07 02:20:10 +00:00
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
2014-07-06 20:53:37 +00:00
|
|
|
|
G_STRUCT_OFFSET (GtkWindowClass, enable_debugging),
|
2014-05-07 02:20:10 +00:00
|
|
|
|
NULL, NULL,
|
2014-09-26 13:37:28 +00:00
|
|
|
|
_gtk_marshal_BOOLEAN__BOOLEAN,
|
|
|
|
|
G_TYPE_BOOLEAN,
|
2014-07-06 20:53:37 +00:00
|
|
|
|
1, G_TYPE_BOOLEAN);
|
2014-05-07 02:20:10 +00:00
|
|
|
|
|
2018-01-01 20:24:16 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow::close-request:
|
|
|
|
|
* @window: the window on which the signal is emitted
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Emitted when the user clicks on the close button of the window.
|
2018-01-01 20:24:16 +00:00
|
|
|
|
*
|
|
|
|
|
* Return: %TRUE to stop other handlers from being invoked for the signal
|
|
|
|
|
*/
|
|
|
|
|
window_signals[CLOSE_REQUEST] =
|
|
|
|
|
g_signal_new (I_("close-request"),
|
|
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
|
G_STRUCT_OFFSET (GtkWindowClass, close_request),
|
|
|
|
|
_gtk_boolean_handled_accumulator, NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
G_TYPE_BOOLEAN,
|
|
|
|
|
0);
|
|
|
|
|
|
2001-04-18 22:21:45 +00:00
|
|
|
|
/*
|
|
|
|
|
* Key bindings
|
|
|
|
|
*/
|
|
|
|
|
|
2020-04-11 03:59:21 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow|default.activate:
|
|
|
|
|
*
|
|
|
|
|
* Activate the default widget.
|
|
|
|
|
*/
|
2019-06-22 18:24:46 +00:00
|
|
|
|
gtk_widget_class_install_action (widget_class, "default.activate", NULL,
|
2019-06-15 01:43:20 +00:00
|
|
|
|
gtk_window_activate_default_activate);
|
|
|
|
|
|
2020-04-22 17:32:10 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkWindow|window.minimize:
|
|
|
|
|
*
|
|
|
|
|
* Close the window.
|
|
|
|
|
*/
|
|
|
|
|
gtk_widget_class_install_action (widget_class, "window.minimize", NULL,
|
|
|
|
|
gtk_window_activate_minimize);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkWindow|window.toggle-maximized:
|
|
|
|
|
*
|
|
|
|
|
* Maximize or restore the window.
|
|
|
|
|
*/
|
|
|
|
|
gtk_widget_class_install_action (widget_class, "window.toggle-maximized", NULL,
|
|
|
|
|
gtk_window_activate_toggle_maximized);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GtkWindow|window.close:
|
|
|
|
|
*
|
|
|
|
|
* Close the window.
|
|
|
|
|
*/
|
|
|
|
|
gtk_widget_class_install_action (widget_class, "window.close", NULL,
|
|
|
|
|
gtk_window_activate_close);
|
|
|
|
|
|
2018-08-04 10:30:53 +00:00
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_space, 0,
|
|
|
|
|
"activate-focus", NULL);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_KP_Space, 0,
|
|
|
|
|
"activate-focus", NULL);
|
Clip the retrieved image data to the screen, using a server grab to avoid
2001-06-28 Havoc Pennington <hp@pobox.com>
* gdk/x11/gdkimage-x11.c (_gdk_x11_get_image): Clip the retrieved
image data to the screen, using a server grab to avoid race
conditions.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): remove
check for NULL return from gtk_image_new_from_stock(), it never
returns NULL.
(gtk_item_factory_create_item): fix bug where we parsed the stock
ID as an inline pixbuf
* gtk/gtktext.c (gtk_text_key_press): numeric keypad support
* gtk/gtkspinbutton.c (gtk_spin_button_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkoptionmenu.c (gtk_option_menu_key_press): numeric keypad
support (should be using binding set here)
* gtk/gtkmenushell.c (gtk_menu_shell_class_init): numeric keypad
support
* gtk/gtkmenu.c (gtk_menu_class_init): numeric keypad support
* gtk/gtkmenubar.c (gtk_menu_bar_class_init): numeric keypad
* gtk/gtklistitem.c (gtk_list_item_class_init): numeric keypad
* gtk/gtkimcontextsimple.c
(gtk_im_context_simple_filter_keypress): keypad
* gtk/gtkfilesel.c (gtk_file_selection_key_press): keypad
* gtk/gtkentry.c (gtk_entry_class_init): numeric keypad fixes
* gtk/gtkctree.c (gtk_ctree_class_init): numeric keypad support
* gtk/gtkcolorsel.c (palette_activate): keypad support (of course,
should be binding-setted)
* gtk/gtkwindow.c (gtk_window_class_init): numeric keypad fixes
* gtk/gtkclist.c (gtk_clist_class_init): numeric keypad fixes
* gtk/gtkcalendar.c: numeric keypad fixes
* gtk/gtktextview.c (gtk_text_view_class_init): numeric keypad
support
* gdk/gdkwindow.c (gdk_window_get_clip_region): fix infinite loop
screwup
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
clip the render area to the drawable's clip region in advance,
so we don't get data from the server that we don't need.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
check return value of gdk_pixbuf_get_from_drawable(), fall back
to bilevel alpha if we can't get the pixbuf to composite against.
* gdk/gdkdraw.c (gdk_drawable_get_image): set the image colormap
* gdk/gdkimage.c (gdk_image_get_colormap): add
gdk_image_set_colormap, gdk_image_get_colormap
* gdk/gdkpixbuf-drawable.c (rgbconvert): Change all converters to
take a region of the image, instead of converting the entire
image.
* gtk/gtkwidget.h (struct _GtkWidgetClass): add show_help
keybinding signal. Add default bindings for it. Add default
handler for show_help that shows the tooltip for the widget.
* gtk/gtkdialog.c (gtk_dialog_class_init): add binding set and
"close" keybinding signal, remove key press handler.
* gtk/gtktooltips.c (gtk_tooltips_set_colors): Just remove this,
it's not our usual practice to leave a deprecated function around
with a runtime warning, plus we don't want it to appear in docs,
plus if we make them yellow no one will want to change them
anyhow.
2001-06-29 01:59:02 +00:00
|
|
|
|
|
2018-08-04 10:30:53 +00:00
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_Return, 0,
|
|
|
|
|
"activate-default", NULL);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_ISO_Enter, 0,
|
|
|
|
|
"activate-default", NULL);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_KP_Enter, 0,
|
|
|
|
|
"activate-default", NULL);
|
|
|
|
|
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_I, GDK_CONTROL_MASK|GDK_SHIFT_MASK,
|
|
|
|
|
"enable-debugging", "(b)", FALSE);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_D, GDK_CONTROL_MASK|GDK_SHIFT_MASK,
|
|
|
|
|
"enable-debugging", "(b)", TRUE);
|
|
|
|
|
|
|
|
|
|
add_arrow_bindings (widget_class, GDK_KEY_Up, GTK_DIR_UP);
|
|
|
|
|
add_arrow_bindings (widget_class, GDK_KEY_Down, GTK_DIR_DOWN);
|
|
|
|
|
add_arrow_bindings (widget_class, GDK_KEY_Left, GTK_DIR_LEFT);
|
|
|
|
|
add_arrow_bindings (widget_class, GDK_KEY_Right, GTK_DIR_RIGHT);
|
|
|
|
|
|
|
|
|
|
add_tab_bindings (widget_class, 0, GTK_DIR_TAB_FORWARD);
|
|
|
|
|
add_tab_bindings (widget_class, GDK_CONTROL_MASK, GTK_DIR_TAB_FORWARD);
|
|
|
|
|
add_tab_bindings (widget_class, GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
|
|
|
|
|
add_tab_bindings (widget_class, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
|
2011-07-02 02:10:27 +00:00
|
|
|
|
|
2017-11-18 03:49:57 +00:00
|
|
|
|
gtk_widget_class_set_css_name (widget_class, I_("window"));
|
2020-07-27 22:25:37 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_WINDOW);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-04-24 19:45:49 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_is_maximized: (attributes org.gtk.Method.get_property=maximized)
|
|
|
|
|
* @window: a `GtkWindow`
|
2013-04-24 19:45:49 +00:00
|
|
|
|
*
|
|
|
|
|
* Retrieves the current maximized state of @window.
|
|
|
|
|
*
|
|
|
|
|
* Note that since maximization is ultimately handled by the window
|
|
|
|
|
* manager and happens asynchronously to an application request, you
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* shouldn’t assume the return value of this function changing
|
2013-04-24 19:45:49 +00:00
|
|
|
|
* immediately (or at all), as an effect of calling
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* [method@Gtk.Window.maximize] or [method@Gtk.Window.unmaximize].
|
2013-04-24 19:45:49 +00:00
|
|
|
|
*
|
2020-12-05 11:11:25 +00:00
|
|
|
|
* If the window isn't yet mapped, the value returned will whether the
|
|
|
|
|
* initial requested state is maximized.
|
|
|
|
|
*
|
2013-04-24 19:45:49 +00:00
|
|
|
|
* Returns: whether the window has a maximized state.
|
|
|
|
|
*/
|
2013-12-11 06:26:34 +00:00
|
|
|
|
gboolean
|
2013-04-24 19:45:49 +00:00
|
|
|
|
gtk_window_is_maximized (GtkWindow *window)
|
2013-12-11 06:26:34 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2013-12-11 06:26:34 +00:00
|
|
|
|
|
2013-04-24 19:45:49 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
|
|
|
|
|
2020-12-16 10:53:19 +00:00
|
|
|
|
return priv->maximized;
|
2013-12-11 06:26:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-12-05 11:22:25 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_is_fullscreen: (attributes org.gtk.Property.get=fullscreened)
|
|
|
|
|
* @window: a `GtkWindow`
|
2020-12-05 11:22:25 +00:00
|
|
|
|
*
|
|
|
|
|
* Retrieves the current fullscreen state of @window.
|
|
|
|
|
*
|
|
|
|
|
* Note that since fullscreening is ultimately handled by the window
|
|
|
|
|
* manager and happens asynchronously to an application request, you
|
|
|
|
|
* shouldn’t assume the return value of this function changing
|
|
|
|
|
* immediately (or at all), as an effect of calling
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* [method@Gtk.Window.fullscreen] or [method@Gtk.Window.unfullscreen].
|
2020-12-05 11:22:25 +00:00
|
|
|
|
*
|
|
|
|
|
* If the window isn't yet mapped, the value returned will whether the
|
|
|
|
|
* initial requested state is fullscreen.
|
|
|
|
|
*
|
|
|
|
|
* Returns: whether the window has a fullscreen state.
|
|
|
|
|
*/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_window_is_fullscreen (GtkWindow *window)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
|
|
|
|
|
2020-12-16 10:53:19 +00:00
|
|
|
|
return priv->fullscreen;
|
2020-12-05 11:22:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-12-11 06:26:34 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_window_toggle_maximized (GtkWindow *window)
|
2012-04-11 16:55:54 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2012-04-11 16:55:54 +00:00
|
|
|
|
|
2013-10-06 04:41:27 +00:00
|
|
|
|
if (priv->maximized)
|
2012-04-11 16:55:54 +00:00
|
|
|
|
gtk_window_unmaximize (window);
|
|
|
|
|
else
|
|
|
|
|
gtk_window_maximize (window);
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-29 02:19:15 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_close:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
|
|
|
|
*
|
|
|
|
|
* Requests that the window is closed.
|
2013-06-29 02:19:15 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* This is similar to what happens when a window manager
|
|
|
|
|
* close button is clicked.
|
2013-06-29 02:19:15 +00:00
|
|
|
|
*
|
|
|
|
|
* This function can be used with close buttons in custom
|
|
|
|
|
* titlebars.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_window_close (GtkWindow *window)
|
2012-04-11 16:55:54 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2015-09-06 23:58:03 +00:00
|
|
|
|
if (!_gtk_widget_get_realized (GTK_WIDGET (window)))
|
2013-06-29 02:19:15 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
if (priv->in_emit_close_request)
|
2018-01-18 14:10:49 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-01-01 20:24:16 +00:00
|
|
|
|
g_object_ref (window);
|
|
|
|
|
|
|
|
|
|
if (!gtk_window_emit_close_request (window))
|
2020-05-09 14:26:22 +00:00
|
|
|
|
gtk_window_destroy (window);
|
2018-01-01 20:24:16 +00:00
|
|
|
|
|
|
|
|
|
g_object_unref (window);
|
2012-04-11 16:55:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-05-20 07:31:17 +00:00
|
|
|
|
static guint
|
|
|
|
|
constraints_for_edge (GdkSurfaceEdge edge)
|
|
|
|
|
{
|
|
|
|
|
switch (edge)
|
|
|
|
|
{
|
|
|
|
|
case GDK_SURFACE_EDGE_NORTH_WEST:
|
2020-09-10 04:39:03 +00:00
|
|
|
|
return GDK_TOPLEVEL_STATE_LEFT_RESIZABLE | GDK_TOPLEVEL_STATE_TOP_RESIZABLE;
|
2020-05-20 07:31:17 +00:00
|
|
|
|
case GDK_SURFACE_EDGE_NORTH:
|
2020-09-10 04:39:03 +00:00
|
|
|
|
return GDK_TOPLEVEL_STATE_TOP_RESIZABLE;
|
2020-05-20 07:31:17 +00:00
|
|
|
|
case GDK_SURFACE_EDGE_NORTH_EAST:
|
2020-09-10 04:39:03 +00:00
|
|
|
|
return GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE | GDK_TOPLEVEL_STATE_TOP_RESIZABLE;
|
2020-05-20 07:31:17 +00:00
|
|
|
|
case GDK_SURFACE_EDGE_WEST:
|
2020-09-10 04:39:03 +00:00
|
|
|
|
return GDK_TOPLEVEL_STATE_LEFT_RESIZABLE;
|
2020-05-20 07:31:17 +00:00
|
|
|
|
case GDK_SURFACE_EDGE_EAST:
|
2020-09-10 04:39:03 +00:00
|
|
|
|
return GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE;
|
2020-05-20 07:31:17 +00:00
|
|
|
|
case GDK_SURFACE_EDGE_SOUTH_WEST:
|
2020-09-10 04:39:03 +00:00
|
|
|
|
return GDK_TOPLEVEL_STATE_LEFT_RESIZABLE | GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE;
|
2020-05-20 07:31:17 +00:00
|
|
|
|
case GDK_SURFACE_EDGE_SOUTH:
|
2020-09-10 04:39:03 +00:00
|
|
|
|
return GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE;
|
2020-05-20 07:31:17 +00:00
|
|
|
|
case GDK_SURFACE_EDGE_SOUTH_EAST:
|
2020-09-10 04:39:03 +00:00
|
|
|
|
return GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE | GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE;
|
2020-05-20 07:31:17 +00:00
|
|
|
|
default:
|
|
|
|
|
g_warn_if_reached ();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
|
static int
|
2020-05-20 07:31:17 +00:00
|
|
|
|
get_number (GtkCssValue *value)
|
|
|
|
|
{
|
|
|
|
|
double d = _gtk_css_number_value_get (value, 100);
|
|
|
|
|
|
|
|
|
|
if (d < 1)
|
|
|
|
|
return ceil (d);
|
|
|
|
|
else
|
|
|
|
|
return floor (d);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
get_box_border (GtkCssStyle *style,
|
|
|
|
|
GtkBorder *border)
|
|
|
|
|
{
|
|
|
|
|
border->top = get_number (style->border->border_top_width);
|
|
|
|
|
border->left = get_number (style->border->border_left_width);
|
|
|
|
|
border->bottom = get_number (style->border->border_bottom_width);
|
|
|
|
|
border->right = get_number (style->border->border_right_width);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
get_edge_for_coordinates (GtkWindow *window,
|
|
|
|
|
double x,
|
|
|
|
|
double y)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
gboolean supports_edge_constraints;
|
|
|
|
|
GtkBorder handle_size;
|
|
|
|
|
GtkCssBoxes css_boxes;
|
|
|
|
|
const graphene_rect_t *border_rect;
|
|
|
|
|
float left, top;
|
|
|
|
|
|
|
|
|
|
#define edge_or_minus_one(edge) ((supports_edge_constraints && (priv->edge_constraints & constraints_for_edge (edge)) != constraints_for_edge (edge)) ? -1 : edge)
|
|
|
|
|
|
|
|
|
|
if (!priv->client_decorated ||
|
|
|
|
|
!priv->resizable ||
|
|
|
|
|
priv->fullscreen ||
|
|
|
|
|
priv->maximized)
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
supports_edge_constraints = gdk_toplevel_supports_edge_constraints (GDK_TOPLEVEL (priv->surface));
|
|
|
|
|
|
|
|
|
|
if (!supports_edge_constraints && priv->tiled)
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
gtk_css_boxes_init (&css_boxes, GTK_WIDGET (window));
|
|
|
|
|
border_rect = gtk_css_boxes_get_padding_rect (&css_boxes);
|
|
|
|
|
|
|
|
|
|
if (priv->use_client_shadow)
|
|
|
|
|
{
|
|
|
|
|
/* We use a maximum of RESIZE_HANDLE_SIZE pixels for the handle size */
|
|
|
|
|
GtkBorder shadow;
|
|
|
|
|
|
|
|
|
|
get_shadow_width (window, &shadow);
|
|
|
|
|
/* This logic is duplicated in update_realized_window_properties() */
|
|
|
|
|
handle_size.left = MIN (RESIZE_HANDLE_SIZE, shadow.left);
|
|
|
|
|
handle_size.top = MIN (RESIZE_HANDLE_SIZE, shadow.top);
|
|
|
|
|
handle_size.right = MIN (RESIZE_HANDLE_SIZE, shadow.right);
|
|
|
|
|
handle_size.bottom = MIN (RESIZE_HANDLE_SIZE, shadow.bottom);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Use border */
|
|
|
|
|
get_box_border (gtk_css_node_get_style (gtk_widget_get_css_node (GTK_WIDGET (window))),
|
|
|
|
|
&handle_size);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
left = border_rect->origin.x;
|
|
|
|
|
top = border_rect->origin.y;
|
|
|
|
|
|
|
|
|
|
if (x < left && x >= left - handle_size.left)
|
|
|
|
|
{
|
2020-12-12 00:32:16 +00:00
|
|
|
|
if (y < top + handle_size.top && y >= top - handle_size.top)
|
2020-05-20 07:31:17 +00:00
|
|
|
|
return edge_or_minus_one (GDK_SURFACE_EDGE_NORTH_WEST);
|
|
|
|
|
|
2020-12-12 00:32:16 +00:00
|
|
|
|
if (y > top + border_rect->size.height - handle_size.bottom &&
|
2020-05-20 07:31:17 +00:00
|
|
|
|
y <= top + border_rect->size.height + handle_size.bottom)
|
|
|
|
|
return edge_or_minus_one (GDK_SURFACE_EDGE_SOUTH_WEST);
|
|
|
|
|
|
|
|
|
|
return edge_or_minus_one (GDK_SURFACE_EDGE_WEST);
|
|
|
|
|
}
|
|
|
|
|
else if (x > left + border_rect->size.width &&
|
|
|
|
|
x <= left + border_rect->size.width + handle_size.right)
|
|
|
|
|
{
|
2020-12-12 00:32:16 +00:00
|
|
|
|
if (y < top + handle_size.top && y >= top - handle_size.top)
|
2020-05-20 07:31:17 +00:00
|
|
|
|
return edge_or_minus_one (GDK_SURFACE_EDGE_NORTH_EAST);
|
|
|
|
|
|
2020-12-12 00:32:16 +00:00
|
|
|
|
if (y > top + border_rect->size.height - handle_size.bottom &&
|
2020-05-20 07:31:17 +00:00
|
|
|
|
y <= top + border_rect->size.height + handle_size.bottom)
|
|
|
|
|
return edge_or_minus_one (GDK_SURFACE_EDGE_SOUTH_EAST);
|
|
|
|
|
|
|
|
|
|
return edge_or_minus_one (GDK_SURFACE_EDGE_EAST);
|
|
|
|
|
}
|
2020-12-12 00:32:16 +00:00
|
|
|
|
else if (y < top && y >= top - handle_size.top)
|
2020-05-20 07:31:17 +00:00
|
|
|
|
{
|
2020-12-12 00:32:16 +00:00
|
|
|
|
if (x < left + handle_size.left && x >= left - handle_size.left)
|
|
|
|
|
return edge_or_minus_one (GDK_SURFACE_EDGE_NORTH_WEST);
|
|
|
|
|
|
|
|
|
|
if (x > left + border_rect->size.width - handle_size.right &&
|
|
|
|
|
x <= left + border_rect->size.width + handle_size.right)
|
|
|
|
|
return edge_or_minus_one (GDK_SURFACE_EDGE_NORTH_EAST);
|
|
|
|
|
|
2020-05-20 07:31:17 +00:00
|
|
|
|
return edge_or_minus_one (GDK_SURFACE_EDGE_NORTH);
|
|
|
|
|
}
|
|
|
|
|
else if (y > top + border_rect->size.height &&
|
|
|
|
|
y <= top + border_rect->size.height + handle_size.bottom)
|
|
|
|
|
{
|
2020-12-12 00:32:16 +00:00
|
|
|
|
if (x < left + handle_size.left && x >= left - handle_size.left)
|
|
|
|
|
return edge_or_minus_one (GDK_SURFACE_EDGE_SOUTH_WEST);
|
|
|
|
|
|
|
|
|
|
if (x > left + border_rect->size.width - handle_size.right &&
|
|
|
|
|
x <= left + border_rect->size.width + handle_size.right)
|
|
|
|
|
return edge_or_minus_one (GDK_SURFACE_EDGE_SOUTH_EAST);
|
|
|
|
|
|
2020-05-20 07:31:17 +00:00
|
|
|
|
return edge_or_minus_one (GDK_SURFACE_EDGE_SOUTH);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-28 14:44:11 +00:00
|
|
|
|
static void
|
2019-05-29 17:10:46 +00:00
|
|
|
|
click_gesture_pressed_cb (GtkGestureClick *gesture,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int n_press,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double x,
|
|
|
|
|
double y,
|
2019-05-29 17:10:46 +00:00
|
|
|
|
GtkWindow *window)
|
2014-03-28 14:44:11 +00:00
|
|
|
|
{
|
2019-05-20 00:38:08 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2014-03-28 14:44:11 +00:00
|
|
|
|
GdkEventSequence *sequence;
|
|
|
|
|
GtkWindowRegion region;
|
2020-02-16 16:09:02 +00:00
|
|
|
|
GdkEvent *event;
|
2020-05-17 16:06:26 +00:00
|
|
|
|
GdkDevice *device;
|
2014-03-28 14:44:11 +00:00
|
|
|
|
guint button;
|
2020-05-02 15:37:51 +00:00
|
|
|
|
double tx, ty;
|
2020-05-20 07:31:17 +00:00
|
|
|
|
int edge;
|
2014-03-28 14:44:11 +00:00
|
|
|
|
|
|
|
|
|
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
|
|
|
|
|
button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
|
|
|
|
|
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
|
2020-05-17 16:06:26 +00:00
|
|
|
|
device = gtk_gesture_get_device (GTK_GESTURE (gesture));
|
2014-03-28 14:44:11 +00:00
|
|
|
|
|
2014-04-08 19:03:07 +00:00
|
|
|
|
if (!event)
|
|
|
|
|
return;
|
|
|
|
|
|
2020-05-02 15:37:51 +00:00
|
|
|
|
if (button != GDK_BUTTON_PRIMARY)
|
2014-03-28 14:44:11 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2020-05-02 15:37:51 +00:00
|
|
|
|
if (priv->maximized)
|
|
|
|
|
return;
|
2014-03-28 14:44:11 +00:00
|
|
|
|
|
2020-05-17 16:06:26 +00:00
|
|
|
|
if (gdk_display_device_is_grabbed (gtk_widget_get_display (GTK_WIDGET (window)), device))
|
2020-05-02 15:37:51 +00:00
|
|
|
|
return;
|
2015-02-25 19:34:12 +00:00
|
|
|
|
|
2020-05-20 07:31:17 +00:00
|
|
|
|
if (!priv->client_decorated)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
edge = get_edge_for_coordinates (window, x, y);
|
2015-02-25 19:34:12 +00:00
|
|
|
|
|
2020-05-20 07:31:17 +00:00
|
|
|
|
if (edge == -1)
|
2020-05-02 15:37:51 +00:00
|
|
|
|
return;
|
2015-02-25 19:34:12 +00:00
|
|
|
|
|
2020-05-20 07:31:17 +00:00
|
|
|
|
region = (GtkWindowRegion)edge;
|
|
|
|
|
|
2020-05-02 15:37:51 +00:00
|
|
|
|
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
2014-03-28 14:44:11 +00:00
|
|
|
|
|
2020-05-02 15:37:51 +00:00
|
|
|
|
gdk_event_get_position (event, &tx, &ty);
|
2020-05-17 16:06:26 +00:00
|
|
|
|
gdk_toplevel_begin_resize (GDK_TOPLEVEL (priv->surface),
|
|
|
|
|
(GdkSurfaceEdge) region,
|
|
|
|
|
device,
|
|
|
|
|
GDK_BUTTON_PRIMARY,
|
|
|
|
|
tx, ty,
|
|
|
|
|
gdk_event_get_time (event));
|
2014-03-28 14:44:11 +00:00
|
|
|
|
|
2020-05-02 15:37:51 +00:00
|
|
|
|
gtk_event_controller_reset (GTK_EVENT_CONTROLLER (gesture));
|
2014-03-28 14:44:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-31 15:31:20 +00:00
|
|
|
|
static void
|
|
|
|
|
device_removed_cb (GdkSeat *seat,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
gpointer user_data)
|
|
|
|
|
{
|
|
|
|
|
GtkWindow *window = user_data;
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-01-02 12:52:14 +00:00
|
|
|
|
GList *l = priv->foci;
|
2017-03-31 15:31:20 +00:00
|
|
|
|
|
|
|
|
|
while (l)
|
|
|
|
|
{
|
2020-01-02 12:52:14 +00:00
|
|
|
|
GList *next;
|
2017-03-31 15:31:20 +00:00
|
|
|
|
GtkPointerFocus *focus = l->data;
|
|
|
|
|
|
2020-01-02 12:52:14 +00:00
|
|
|
|
next = l->next;
|
2017-03-31 15:31:20 +00:00
|
|
|
|
|
|
|
|
|
if (focus->device == device)
|
|
|
|
|
{
|
2020-01-02 12:52:14 +00:00
|
|
|
|
priv->foci = g_list_delete_link (priv->foci, l);
|
2017-05-25 14:00:40 +00:00
|
|
|
|
gtk_pointer_focus_unref (focus);
|
2017-03-31 15:31:20 +00:00
|
|
|
|
}
|
2020-01-02 12:52:14 +00:00
|
|
|
|
|
|
|
|
|
l = next;
|
2017-03-31 15:31:20 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-27 10:42:06 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_capture_motion (GtkWidget *widget,
|
2020-05-20 07:31:17 +00:00
|
|
|
|
double x,
|
|
|
|
|
double y)
|
2017-04-02 16:36:21 +00:00
|
|
|
|
{
|
2020-04-10 18:35:02 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-05-20 07:31:17 +00:00
|
|
|
|
const char *cursor_names[8] = {
|
2017-04-02 16:36:21 +00:00
|
|
|
|
"nw-resize", "n-resize", "ne-resize",
|
|
|
|
|
"w-resize", "e-resize",
|
|
|
|
|
"sw-resize", "s-resize", "se-resize"
|
|
|
|
|
};
|
2020-05-20 07:31:17 +00:00
|
|
|
|
int edge;
|
|
|
|
|
|
|
|
|
|
edge = get_edge_for_coordinates (window, x, y);
|
|
|
|
|
if (edge != -1 &&
|
|
|
|
|
priv->resize_cursor &&
|
|
|
|
|
strcmp (gdk_cursor_get_name (priv->resize_cursor), cursor_names[edge]) == 0)
|
|
|
|
|
return;
|
2017-04-02 16:36:21 +00:00
|
|
|
|
|
2020-04-10 18:35:02 +00:00
|
|
|
|
g_clear_object (&priv->resize_cursor);
|
|
|
|
|
|
2020-05-20 07:31:17 +00:00
|
|
|
|
if (edge != -1)
|
|
|
|
|
priv->resize_cursor = gdk_cursor_new_from_name (cursor_names[edge], NULL);
|
2019-04-18 20:15:39 +00:00
|
|
|
|
|
2020-04-10 18:35:02 +00:00
|
|
|
|
gtk_window_maybe_update_cursor (window, widget, NULL);
|
2017-04-02 16:36:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-04-27 03:12:54 +00:00
|
|
|
|
static void
|
2019-06-15 01:43:20 +00:00
|
|
|
|
gtk_window_activate_default_activate (GtkWidget *widget,
|
|
|
|
|
const char *name,
|
|
|
|
|
GVariant *parameter)
|
2019-04-27 03:12:54 +00:00
|
|
|
|
{
|
2019-06-15 01:43:20 +00:00
|
|
|
|
gtk_window_real_activate_default (GTK_WINDOW (widget));
|
2019-04-27 03:12:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-22 17:32:10 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_activate_minimize (GtkWidget *widget,
|
|
|
|
|
const char *name,
|
|
|
|
|
GVariant *parameter)
|
|
|
|
|
{
|
|
|
|
|
gtk_window_minimize (GTK_WINDOW (widget));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_window_activate_toggle_maximized (GtkWidget *widget,
|
|
|
|
|
const char *name,
|
|
|
|
|
GVariant *parameter)
|
|
|
|
|
{
|
|
|
|
|
_gtk_window_toggle_maximized (GTK_WINDOW (widget));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_window_activate_close (GtkWidget *widget,
|
|
|
|
|
const char *name,
|
|
|
|
|
GVariant *parameter)
|
|
|
|
|
{
|
|
|
|
|
gtk_window_close (GTK_WINDOW (widget));
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-29 02:47:17 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_window_accept_rootwindow_drop (GtkDropTargetAsync *self,
|
|
|
|
|
GdkDrop *drop,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer unused)
|
|
|
|
|
{
|
|
|
|
|
gdk_drop_finish (drop, GDK_ACTION_MOVE);
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_init (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2013-07-05 18:24:38 +00:00
|
|
|
|
GtkWidget *widget;
|
2017-03-31 15:31:20 +00:00
|
|
|
|
GdkSeat *seat;
|
2020-02-20 01:51:03 +00:00
|
|
|
|
GtkEventController *controller;
|
2020-02-29 02:47:17 +00:00
|
|
|
|
GtkDropTargetAsync *target;
|
2018-08-15 04:43:31 +00:00
|
|
|
|
GtkShortcut *shortcut;
|
2013-07-05 18:24:38 +00:00
|
|
|
|
|
|
|
|
|
widget = GTK_WIDGET (window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
2020-05-20 07:24:00 +00:00
|
|
|
|
gtk_widget_set_overflow (widget, GTK_OVERFLOW_HIDDEN);
|
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
priv->title = NULL;
|
|
|
|
|
priv->geometry_info = NULL;
|
|
|
|
|
priv->focus_widget = NULL;
|
|
|
|
|
priv->default_widget = NULL;
|
|
|
|
|
priv->resizable = TRUE;
|
2013-05-11 22:45:27 +00:00
|
|
|
|
priv->need_default_size = TRUE;
|
2010-08-17 13:37:57 +00:00
|
|
|
|
priv->modal = FALSE;
|
|
|
|
|
priv->decorated = TRUE;
|
2017-10-31 06:41:15 +00:00
|
|
|
|
priv->display = gdk_display_get_default ();
|
2003-12-10 23:58:23 +00:00
|
|
|
|
|
gdk: Replace 'WITHDRAWN' state with async 'is-mapped' boolean
It was used by all surfaces to track 'is-mapped', but still part of the
GdkToplevelState, and is now replaced with a separate boolean in the
GdkSurface structure.
It also caused issues when a widget was unmapped, and due to that
unmapped a popover which hid its corresponding surface. When this
surface was hidden, it emitted a state change event, which would then go
back into GTK and queue a resize on popover widget, which would travel
back down to the widget that was originally unmapped, causing confusino
when doing future allocations.
To summarize, one should not hide widgets during allocation, and to
avoid this, make this new is-mapped boolean asynchronous when hiding a
surface, meaning the notification event for the changed mapped state
will be emitted in an idle callback. This avoids the above described
reentry issue.
2020-12-07 17:18:38 +00:00
|
|
|
|
priv->state = 0;
|
2017-12-15 02:07:39 +00:00
|
|
|
|
|
2005-08-30 04:46:09 +00:00
|
|
|
|
priv->deletable = TRUE;
|
2007-03-13 17:03:54 +00:00
|
|
|
|
priv->startup_id = NULL;
|
2011-04-12 17:03:38 +00:00
|
|
|
|
priv->initial_timestamp = GDK_CURRENT_TIME;
|
2019-06-21 02:26:04 +00:00
|
|
|
|
priv->mnemonics_visible = FALSE;
|
2011-08-10 14:00:38 +00:00
|
|
|
|
priv->focus_visible = TRUE;
|
2017-11-01 15:52:56 +00:00
|
|
|
|
priv->initial_fullscreen_monitor = NULL;
|
2003-12-10 23:58:23 +00:00
|
|
|
|
|
2005-11-23 18:06:58 +00:00
|
|
|
|
g_object_ref_sink (window);
|
2001-01-08 17:04:17 +00:00
|
|
|
|
|
2011-03-20 13:37:27 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
2017-10-31 06:41:15 +00:00
|
|
|
|
g_signal_connect (gtk_settings_get_for_display (priv->display),
|
|
|
|
|
"notify::gtk-application-prefer-dark-theme",
|
|
|
|
|
G_CALLBACK (gtk_window_on_theme_variant_changed), window);
|
2011-03-20 13:37:27 +00:00
|
|
|
|
#endif
|
2012-09-10 10:29:09 +00:00
|
|
|
|
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (widget, "background");
|
2013-06-28 08:39:52 +00:00
|
|
|
|
|
2013-07-05 18:24:38 +00:00
|
|
|
|
priv->scale = gtk_widget_get_scale_factor (widget);
|
2016-03-09 16:37:27 +00:00
|
|
|
|
|
2020-02-29 02:47:17 +00:00
|
|
|
|
target = gtk_drop_target_async_new (gdk_content_formats_new ((const char*[1]) { "application/x-rootwindow-drop" }, 1),
|
|
|
|
|
GDK_ACTION_MOVE);
|
|
|
|
|
g_signal_connect (target, "drop", G_CALLBACK (gtk_window_accept_rootwindow_drop), NULL);
|
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (window), GTK_EVENT_CONTROLLER (target));
|
2017-03-31 15:31:20 +00:00
|
|
|
|
|
|
|
|
|
seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
|
2020-05-15 01:27:45 +00:00
|
|
|
|
if (seat)
|
|
|
|
|
g_signal_connect (seat, "device-removed",
|
|
|
|
|
G_CALLBACK (device_removed_cb), window);
|
2017-04-02 16:36:21 +00:00
|
|
|
|
|
2018-08-15 04:43:31 +00:00
|
|
|
|
controller = gtk_event_controller_motion_new ();
|
|
|
|
|
gtk_event_controller_set_propagation_phase (controller,
|
2018-06-27 10:42:06 +00:00
|
|
|
|
GTK_PHASE_CAPTURE);
|
2018-08-15 04:43:31 +00:00
|
|
|
|
g_signal_connect_swapped (controller, "motion",
|
2018-06-27 10:42:06 +00:00
|
|
|
|
G_CALLBACK (gtk_window_capture_motion), window);
|
2018-08-15 04:43:31 +00:00
|
|
|
|
gtk_widget_add_controller (widget, controller);
|
2018-06-06 23:23:59 +00:00
|
|
|
|
|
2020-10-11 08:22:20 +00:00
|
|
|
|
controller = gtk_event_controller_key_new ();
|
|
|
|
|
gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_CAPTURE);
|
|
|
|
|
g_signal_connect_swapped (controller, "key-pressed",
|
2019-06-21 02:55:27 +00:00
|
|
|
|
G_CALLBACK (gtk_window_key_pressed), window);
|
2020-10-11 08:22:20 +00:00
|
|
|
|
g_signal_connect_swapped (controller, "key-released",
|
2019-06-21 02:22:26 +00:00
|
|
|
|
G_CALLBACK (gtk_window_key_released), window);
|
2020-10-11 08:22:20 +00:00
|
|
|
|
gtk_widget_add_controller (widget, controller);
|
2020-04-15 18:43:00 +00:00
|
|
|
|
|
|
|
|
|
controller = gtk_event_controller_legacy_new ();
|
|
|
|
|
gtk_event_controller_set_name (controller, "gtk-window-toplevel-focus");
|
|
|
|
|
g_signal_connect_swapped (controller, "event",
|
|
|
|
|
G_CALLBACK (gtk_window_handle_focus), window);
|
2020-02-20 01:51:03 +00:00
|
|
|
|
gtk_widget_add_controller (widget, controller);
|
2019-04-09 13:22:19 +00:00
|
|
|
|
|
2018-08-15 04:43:31 +00:00
|
|
|
|
controller = gtk_shortcut_controller_new ();
|
|
|
|
|
gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_CAPTURE);
|
|
|
|
|
|
2018-08-18 18:01:43 +00:00
|
|
|
|
shortcut = gtk_shortcut_new (gtk_keyval_trigger_new (MENU_BAR_ACCEL, 0),
|
|
|
|
|
gtk_callback_action_new (gtk_window_activate_menubar, NULL, NULL));
|
2018-08-15 04:43:31 +00:00
|
|
|
|
gtk_shortcut_controller_add_shortcut (GTK_SHORTCUT_CONTROLLER (controller), shortcut);
|
|
|
|
|
gtk_event_controller_set_name (controller, "gtk-window-menubar-accel");
|
|
|
|
|
gtk_widget_add_controller (widget, controller);
|
2021-03-14 23:37:11 +00:00
|
|
|
|
|
|
|
|
|
priv->menubar_controller = controller;
|
2014-05-09 22:55:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_constructed (GObject *object)
|
2014-05-09 22:55:48 +00:00
|
|
|
|
{
|
2014-06-26 22:22:42 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (object);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2014-05-09 22:55:48 +00:00
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_window_parent_class)->constructed (object);
|
2014-03-28 14:44:11 +00:00
|
|
|
|
|
2020-02-14 20:13:42 +00:00
|
|
|
|
priv->click_gesture = gtk_gesture_click_new ();
|
|
|
|
|
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->click_gesture), 0);
|
|
|
|
|
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->click_gesture),
|
|
|
|
|
GTK_PHASE_BUBBLE);
|
|
|
|
|
g_signal_connect (priv->click_gesture, "pressed",
|
|
|
|
|
G_CALLBACK (click_gesture_pressed_cb), object);
|
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (object), GTK_EVENT_CONTROLLER (priv->click_gesture));
|
2015-02-25 19:34:12 +00:00
|
|
|
|
|
2018-08-27 06:37:16 +00:00
|
|
|
|
g_list_store_append (toplevel_list, window);
|
2020-10-24 19:23:12 +00:00
|
|
|
|
|
|
|
|
|
gtk_accessible_update_state (GTK_ACCESSIBLE (window),
|
|
|
|
|
GTK_ACCESSIBLE_STATE_HIDDEN, TRUE,
|
|
|
|
|
-1);
|
|
|
|
|
|
2018-08-27 06:37:16 +00:00
|
|
|
|
g_object_unref (window);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2001-03-12 21:01:53 +00:00
|
|
|
|
gtk_window_set_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
const GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-17 13:37:57 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (object);
|
2010-10-08 05:43:03 +00:00
|
|
|
|
|
2001-03-12 21:01:53 +00:00
|
|
|
|
switch (prop_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2001-03-12 21:01:53 +00:00
|
|
|
|
case PROP_TITLE:
|
|
|
|
|
gtk_window_set_title (window, g_value_get_string (value));
|
1998-01-16 00:49:51 +00:00
|
|
|
|
break;
|
2007-03-13 17:03:54 +00:00
|
|
|
|
case PROP_STARTUP_ID:
|
|
|
|
|
gtk_window_set_startup_id (window, g_value_get_string (value));
|
2010-10-08 05:43:03 +00:00
|
|
|
|
break;
|
2001-06-26 19:23:46 +00:00
|
|
|
|
case PROP_RESIZABLE:
|
2010-10-08 05:43:03 +00:00
|
|
|
|
gtk_window_set_resizable (window, g_value_get_boolean (value));
|
1998-01-18 11:09:04 +00:00
|
|
|
|
break;
|
2001-03-12 21:01:53 +00:00
|
|
|
|
case PROP_MODAL:
|
|
|
|
|
gtk_window_set_modal (window, g_value_get_boolean (value));
|
1999-02-20 19:00:53 +00:00
|
|
|
|
break;
|
2001-03-12 21:01:53 +00:00
|
|
|
|
case PROP_DEFAULT_WIDTH:
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
gtk_window_set_default_size_internal (window,
|
|
|
|
|
TRUE, g_value_get_int (value),
|
2016-09-05 01:09:39 +00:00
|
|
|
|
FALSE, -1);
|
2020-12-05 10:44:51 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (window));
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
break;
|
2001-03-12 21:01:53 +00:00
|
|
|
|
case PROP_DEFAULT_HEIGHT:
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
gtk_window_set_default_size_internal (window,
|
|
|
|
|
FALSE, -1,
|
2016-09-05 01:09:39 +00:00
|
|
|
|
TRUE, g_value_get_int (value));
|
2020-12-05 10:44:51 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (window));
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
break;
|
2001-03-12 21:01:53 +00:00
|
|
|
|
case PROP_DESTROY_WITH_PARENT:
|
|
|
|
|
gtk_window_set_destroy_with_parent (window, g_value_get_boolean (value));
|
2000-10-20 23:14:41 +00:00
|
|
|
|
break;
|
2017-12-31 15:42:10 +00:00
|
|
|
|
case PROP_HIDE_ON_CLOSE:
|
|
|
|
|
gtk_window_set_hide_on_close (window, g_value_get_boolean (value));
|
|
|
|
|
break;
|
2004-07-17 03:55:07 +00:00
|
|
|
|
case PROP_ICON_NAME:
|
|
|
|
|
gtk_window_set_icon_name (window, g_value_get_string (value));
|
|
|
|
|
break;
|
2017-10-31 06:41:15 +00:00
|
|
|
|
case PROP_DISPLAY:
|
|
|
|
|
gtk_window_set_display (window, g_value_get_object (value));
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
|
break;
|
2003-07-18 22:00:20 +00:00
|
|
|
|
case PROP_DECORATED:
|
|
|
|
|
gtk_window_set_decorated (window, g_value_get_boolean (value));
|
|
|
|
|
break;
|
2005-08-30 04:46:09 +00:00
|
|
|
|
case PROP_DELETABLE:
|
|
|
|
|
gtk_window_set_deletable (window, g_value_get_boolean (value));
|
|
|
|
|
break;
|
2006-05-12 09:47:58 +00:00
|
|
|
|
case PROP_TRANSIENT_FOR:
|
|
|
|
|
gtk_window_set_transient_for (window, g_value_get_object (value));
|
|
|
|
|
break;
|
2010-08-11 05:23:23 +00:00
|
|
|
|
case PROP_APPLICATION:
|
|
|
|
|
gtk_window_set_application (window, g_value_get_object (value));
|
|
|
|
|
break;
|
2019-04-28 16:45:22 +00:00
|
|
|
|
case PROP_DEFAULT_WIDGET:
|
2019-04-27 03:20:41 +00:00
|
|
|
|
gtk_window_set_default_widget (window, g_value_get_object (value));
|
2019-04-28 16:45:22 +00:00
|
|
|
|
break;
|
2009-12-20 08:04:52 +00:00
|
|
|
|
case PROP_MNEMONICS_VISIBLE:
|
|
|
|
|
gtk_window_set_mnemonics_visible (window, g_value_get_boolean (value));
|
|
|
|
|
break;
|
2011-08-10 14:00:38 +00:00
|
|
|
|
case PROP_FOCUS_VISIBLE:
|
|
|
|
|
gtk_window_set_focus_visible (window, g_value_get_boolean (value));
|
|
|
|
|
break;
|
2020-12-05 11:11:25 +00:00
|
|
|
|
case PROP_MAXIMIZED:
|
|
|
|
|
if (g_value_get_boolean (value))
|
|
|
|
|
gtk_window_maximize (window);
|
|
|
|
|
else
|
|
|
|
|
gtk_window_unmaximize (window);
|
|
|
|
|
break;
|
2020-12-09 00:11:49 +00:00
|
|
|
|
case PROP_FULLSCREENED:
|
2020-12-05 11:22:25 +00:00
|
|
|
|
if (g_value_get_boolean (value))
|
|
|
|
|
gtk_window_fullscreen (window);
|
|
|
|
|
else
|
|
|
|
|
gtk_window_unfullscreen (window);
|
|
|
|
|
break;
|
2020-03-29 19:19:23 +00:00
|
|
|
|
case PROP_FOCUS_WIDGET:
|
2019-03-02 13:46:21 +00:00
|
|
|
|
gtk_window_set_focus (window, g_value_get_object (value));
|
|
|
|
|
break;
|
2020-05-02 15:33:10 +00:00
|
|
|
|
case PROP_CHILD:
|
|
|
|
|
gtk_window_set_child (window, g_value_get_object (value));
|
|
|
|
|
break;
|
2021-03-14 23:37:11 +00:00
|
|
|
|
case PROP_HANDLE_MENUBAR_ACCEL:
|
|
|
|
|
gtk_window_set_handle_menubar_accel (window, g_value_get_boolean (value));
|
|
|
|
|
break;
|
1998-01-21 23:03:11 +00:00
|
|
|
|
default:
|
2008-01-06 03:28:40 +00:00
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
1998-01-21 23:03:11 +00:00
|
|
|
|
break;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1998-01-17 07:52:38 +00:00
|
|
|
|
static void
|
2001-03-12 21:01:53 +00:00
|
|
|
|
gtk_window_get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
1998-01-17 07:52:38 +00:00
|
|
|
|
{
|
2010-08-17 13:37:57 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (object);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
1998-06-28 07:46:10 +00:00
|
|
|
|
|
2001-03-12 21:01:53 +00:00
|
|
|
|
switch (prop_id)
|
1998-01-17 07:52:38 +00:00
|
|
|
|
{
|
2001-03-12 21:01:53 +00:00
|
|
|
|
case PROP_TITLE:
|
2010-08-17 13:37:57 +00:00
|
|
|
|
g_value_set_string (value, priv->title);
|
1998-01-17 07:52:38 +00:00
|
|
|
|
break;
|
2001-06-26 19:23:46 +00:00
|
|
|
|
case PROP_RESIZABLE:
|
2010-08-17 13:37:57 +00:00
|
|
|
|
g_value_set_boolean (value, priv->resizable);
|
2001-06-26 19:23:46 +00:00
|
|
|
|
break;
|
2001-03-12 21:01:53 +00:00
|
|
|
|
case PROP_MODAL:
|
2010-08-17 13:37:57 +00:00
|
|
|
|
g_value_set_boolean (value, priv->modal);
|
1999-02-20 19:00:53 +00:00
|
|
|
|
break;
|
2001-03-12 21:01:53 +00:00
|
|
|
|
case PROP_DEFAULT_WIDTH:
|
2020-12-05 10:44:51 +00:00
|
|
|
|
g_value_set_int (value, priv->default_width);
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
break;
|
2001-03-12 21:01:53 +00:00
|
|
|
|
case PROP_DEFAULT_HEIGHT:
|
2020-12-05 10:44:51 +00:00
|
|
|
|
g_value_set_int (value, priv->default_height);
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
break;
|
2001-03-12 21:01:53 +00:00
|
|
|
|
case PROP_DESTROY_WITH_PARENT:
|
2010-08-17 13:37:57 +00:00
|
|
|
|
g_value_set_boolean (value, priv->destroy_with_parent);
|
2000-10-20 23:14:41 +00:00
|
|
|
|
break;
|
2017-12-31 15:42:10 +00:00
|
|
|
|
case PROP_HIDE_ON_CLOSE:
|
|
|
|
|
g_value_set_boolean (value, priv->hide_on_close);
|
|
|
|
|
break;
|
2004-07-17 03:55:07 +00:00
|
|
|
|
case PROP_ICON_NAME:
|
|
|
|
|
g_value_set_string (value, gtk_window_get_icon_name (window));
|
|
|
|
|
break;
|
2017-10-31 06:41:15 +00:00
|
|
|
|
case PROP_DISPLAY:
|
|
|
|
|
g_value_set_object (value, priv->display);
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
|
break;
|
2002-06-06 15:38:39 +00:00
|
|
|
|
case PROP_IS_ACTIVE:
|
2010-08-17 13:37:57 +00:00
|
|
|
|
g_value_set_boolean (value, priv->is_active);
|
2002-06-06 15:38:39 +00:00
|
|
|
|
break;
|
2003-07-18 22:00:20 +00:00
|
|
|
|
case PROP_DECORATED:
|
|
|
|
|
g_value_set_boolean (value, gtk_window_get_decorated (window));
|
|
|
|
|
break;
|
2005-08-30 04:46:09 +00:00
|
|
|
|
case PROP_DELETABLE:
|
|
|
|
|
g_value_set_boolean (value, gtk_window_get_deletable (window));
|
|
|
|
|
break;
|
2006-05-12 09:47:58 +00:00
|
|
|
|
case PROP_TRANSIENT_FOR:
|
|
|
|
|
g_value_set_object (value, gtk_window_get_transient_for (window));
|
|
|
|
|
break;
|
2010-08-11 05:23:23 +00:00
|
|
|
|
case PROP_APPLICATION:
|
|
|
|
|
g_value_set_object (value, gtk_window_get_application (window));
|
|
|
|
|
break;
|
2019-04-28 16:45:22 +00:00
|
|
|
|
case PROP_DEFAULT_WIDGET:
|
|
|
|
|
g_value_set_object (value, gtk_window_get_default_widget (window));
|
|
|
|
|
break;
|
2009-12-20 08:04:52 +00:00
|
|
|
|
case PROP_MNEMONICS_VISIBLE:
|
|
|
|
|
g_value_set_boolean (value, priv->mnemonics_visible);
|
|
|
|
|
break;
|
2011-08-10 14:00:38 +00:00
|
|
|
|
case PROP_FOCUS_VISIBLE:
|
|
|
|
|
g_value_set_boolean (value, priv->focus_visible);
|
|
|
|
|
break;
|
2020-12-05 11:11:25 +00:00
|
|
|
|
case PROP_MAXIMIZED:
|
2013-04-24 19:45:49 +00:00
|
|
|
|
g_value_set_boolean (value, gtk_window_is_maximized (window));
|
|
|
|
|
break;
|
2020-12-09 00:11:49 +00:00
|
|
|
|
case PROP_FULLSCREENED:
|
2020-12-05 11:22:25 +00:00
|
|
|
|
g_value_set_boolean (value, gtk_window_is_fullscreen (window));
|
|
|
|
|
break;
|
2020-03-29 19:19:23 +00:00
|
|
|
|
case PROP_FOCUS_WIDGET:
|
2019-03-02 13:46:21 +00:00
|
|
|
|
g_value_set_object (value, gtk_window_get_focus (window));
|
|
|
|
|
break;
|
2020-05-02 15:33:10 +00:00
|
|
|
|
case PROP_CHILD:
|
|
|
|
|
g_value_set_object (value, gtk_window_get_child (window));
|
|
|
|
|
break;
|
2021-03-14 23:37:11 +00:00
|
|
|
|
case PROP_HANDLE_MENUBAR_ACCEL:
|
|
|
|
|
g_value_set_boolean (value, gtk_window_get_handle_menubar_accel (window));
|
|
|
|
|
break;
|
1998-01-17 07:52:38 +00:00
|
|
|
|
default:
|
2001-03-12 21:01:53 +00:00
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
1998-01-17 07:52:38 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_buildable_interface_init (GtkBuildableIface *iface)
|
|
|
|
|
{
|
|
|
|
|
parent_buildable_iface = g_type_interface_peek_parent (iface);
|
2007-06-19 12:23:36 +00:00
|
|
|
|
iface->set_buildable_property = gtk_window_buildable_set_buildable_property;
|
2013-05-04 20:51:37 +00:00
|
|
|
|
iface->add_child = gtk_window_buildable_add_child;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_window_buildable_add_child (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *type)
|
2013-05-04 20:51:37 +00:00
|
|
|
|
{
|
|
|
|
|
if (type && strcmp (type, "titlebar") == 0)
|
|
|
|
|
gtk_window_set_titlebar (GTK_WINDOW (buildable), GTK_WIDGET (child));
|
2020-05-02 19:17:20 +00:00
|
|
|
|
else if (GTK_IS_WIDGET (child))
|
|
|
|
|
gtk_window_set_child (GTK_WINDOW (buildable), GTK_WIDGET (child));
|
2013-05-04 20:51:37 +00:00
|
|
|
|
else
|
2018-03-08 02:13:57 +00:00
|
|
|
|
parent_buildable_iface->add_child (buildable, builder, child, type);
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2013-07-05 18:24:38 +00:00
|
|
|
|
gtk_window_buildable_set_buildable_property (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *name,
|
2013-07-05 18:24:38 +00:00
|
|
|
|
const GValue *value)
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
{
|
2010-08-17 13:37:57 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (buildable);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
|
|
|
|
|
if (strcmp (name, "visible") == 0 && g_value_get_boolean (value))
|
|
|
|
|
priv->builder_visible = TRUE;
|
2019-04-28 19:37:41 +00:00
|
|
|
|
else if (parent_buildable_iface->set_buildable_property)
|
2007-06-19 12:23:36 +00:00
|
|
|
|
parent_buildable_iface->set_buildable_property (buildable, builder, name, value);
|
2019-04-28 19:37:41 +00:00
|
|
|
|
else
|
|
|
|
|
g_object_set_property (G_OBJECT (buildable), name, value);
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-06 15:43:55 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_shortcut_manager_interface_init (GtkShortcutManagerInterface *iface)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-29 02:11:14 +00:00
|
|
|
|
static GdkDisplay *
|
|
|
|
|
gtk_window_root_get_display (GtkRoot *root)
|
|
|
|
|
{
|
|
|
|
|
GtkWindow *window = GTK_WINDOW (root);
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
return priv->display;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-26 17:43:46 +00:00
|
|
|
|
static GdkSurface *
|
|
|
|
|
gtk_window_native_get_surface (GtkNative *native)
|
|
|
|
|
{
|
|
|
|
|
GtkWindow *self = GTK_WINDOW (native);
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (self);
|
|
|
|
|
|
|
|
|
|
return priv->surface;
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-10 00:06:39 +00:00
|
|
|
|
static GskRenderer *
|
2019-05-26 17:43:46 +00:00
|
|
|
|
gtk_window_native_get_renderer (GtkNative *native)
|
2019-02-10 00:06:39 +00:00
|
|
|
|
{
|
2019-05-26 17:43:46 +00:00
|
|
|
|
GtkWindow *self = GTK_WINDOW (native);
|
2019-02-10 00:06:39 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (self);
|
|
|
|
|
|
|
|
|
|
return priv->renderer;
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-09 13:22:19 +00:00
|
|
|
|
static GtkConstraintSolver *
|
|
|
|
|
gtk_window_root_get_constraint_solver (GtkRoot *root)
|
|
|
|
|
{
|
|
|
|
|
GtkWindow *self = GTK_WINDOW (root);
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (self);
|
|
|
|
|
|
2020-05-13 07:21:01 +00:00
|
|
|
|
if (!priv->constraint_solver)
|
|
|
|
|
{
|
|
|
|
|
/* Shared constraint solver */
|
|
|
|
|
priv->constraint_solver = gtk_constraint_solver_new ();
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-09 13:22:19 +00:00
|
|
|
|
return priv->constraint_solver;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-29 19:19:23 +00:00
|
|
|
|
static GtkWidget *
|
|
|
|
|
gtk_window_root_get_focus (GtkRoot *root)
|
|
|
|
|
{
|
|
|
|
|
GtkWindow *self = GTK_WINDOW (root);
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (self);
|
|
|
|
|
|
|
|
|
|
return priv->focus_widget;
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-30 17:22:26 +00:00
|
|
|
|
static void synthesize_focus_change_events (GtkWindow *window,
|
|
|
|
|
GtkWidget *old_focus,
|
|
|
|
|
GtkWidget *new_focus,
|
|
|
|
|
GtkCrossingType type);
|
2020-03-29 19:19:23 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_window_root_set_focus (GtkRoot *root,
|
|
|
|
|
GtkWidget *focus)
|
|
|
|
|
{
|
|
|
|
|
GtkWindow *self = GTK_WINDOW (root);
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (self);
|
|
|
|
|
GtkWidget *old_focus = NULL;
|
|
|
|
|
|
|
|
|
|
if (focus && !gtk_widget_is_sensitive (focus))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (focus == priv->focus_widget)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (priv->focus_widget)
|
|
|
|
|
old_focus = g_object_ref (priv->focus_widget);
|
|
|
|
|
g_set_object (&priv->focus_widget, NULL);
|
|
|
|
|
|
|
|
|
|
if (old_focus)
|
|
|
|
|
gtk_widget_set_has_focus (old_focus, FALSE);
|
|
|
|
|
|
2020-07-30 17:22:26 +00:00
|
|
|
|
synthesize_focus_change_events (self, old_focus, focus, GTK_CROSSING_FOCUS);
|
2020-03-29 19:19:23 +00:00
|
|
|
|
|
|
|
|
|
if (focus)
|
|
|
|
|
gtk_widget_set_has_focus (focus, TRUE);
|
|
|
|
|
|
|
|
|
|
g_set_object (&priv->focus_widget, focus);
|
|
|
|
|
|
|
|
|
|
g_clear_object (&old_focus);
|
|
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (self), "focus-widget");
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-09 21:15:32 +00:00
|
|
|
|
static void
|
2019-05-26 17:43:46 +00:00
|
|
|
|
gtk_window_native_get_surface_transform (GtkNative *native,
|
2020-05-17 21:08:01 +00:00
|
|
|
|
double *x,
|
|
|
|
|
double *y)
|
2019-02-09 21:15:32 +00:00
|
|
|
|
{
|
2020-05-02 08:25:12 +00:00
|
|
|
|
GtkBorder shadow;
|
2020-05-20 07:27:37 +00:00
|
|
|
|
GtkCssBoxes css_boxes;
|
|
|
|
|
const graphene_rect_t *margin_rect;
|
2019-02-10 05:26:41 +00:00
|
|
|
|
|
2020-05-02 08:25:12 +00:00
|
|
|
|
get_shadow_width (GTK_WINDOW (native), &shadow);
|
2020-05-20 07:27:37 +00:00
|
|
|
|
gtk_css_boxes_init (&css_boxes, GTK_WIDGET (native));
|
|
|
|
|
margin_rect = gtk_css_boxes_get_margin_rect (&css_boxes);
|
2019-02-10 05:26:41 +00:00
|
|
|
|
|
2020-05-20 07:27:37 +00:00
|
|
|
|
*x = shadow.left - margin_rect->origin.x;
|
|
|
|
|
*y = shadow.top - margin_rect->origin.y;
|
2019-02-09 21:15:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-12-02 10:59:23 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_native_layout (GtkNative *native,
|
|
|
|
|
int width,
|
|
|
|
|
int height)
|
|
|
|
|
{
|
|
|
|
|
GtkWindow *window = GTK_WINDOW (native);
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (native);
|
|
|
|
|
|
|
|
|
|
if (priv->surface_width != width || priv->surface_height != height)
|
|
|
|
|
{
|
|
|
|
|
surface_size_changed (widget, width, height);
|
|
|
|
|
priv->surface_width = width;
|
|
|
|
|
priv->surface_height = height;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-03 21:50:31 +00:00
|
|
|
|
/* This fake motion event is needed for getting up to date pointer focus
|
|
|
|
|
* and coordinates when tho pointer didn't move but the layout changed
|
|
|
|
|
* within the window.
|
|
|
|
|
*/
|
|
|
|
|
if (gtk_widget_needs_allocate (widget))
|
2020-12-02 10:59:23 +00:00
|
|
|
|
{
|
2020-12-03 21:50:31 +00:00
|
|
|
|
GdkSeat *seat;
|
2020-12-02 10:59:23 +00:00
|
|
|
|
|
2020-12-03 21:50:31 +00:00
|
|
|
|
seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
|
|
|
|
|
if (seat)
|
2020-12-02 10:59:23 +00:00
|
|
|
|
{
|
2020-12-03 21:50:31 +00:00
|
|
|
|
GdkDevice *device;
|
|
|
|
|
GtkWidget *focus;
|
|
|
|
|
|
|
|
|
|
device = gdk_seat_get_pointer (seat);
|
|
|
|
|
focus = gtk_window_lookup_pointer_focus_widget (GTK_WINDOW (widget),
|
|
|
|
|
device, NULL);
|
|
|
|
|
if (focus)
|
|
|
|
|
{
|
|
|
|
|
GdkSurface *focus_surface =
|
|
|
|
|
gtk_native_get_surface (gtk_widget_get_native (focus));
|
|
|
|
|
|
|
|
|
|
gdk_surface_request_motion (focus_surface);
|
|
|
|
|
}
|
2020-12-02 10:59:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (gtk_widget_needs_allocate (widget))
|
|
|
|
|
{
|
|
|
|
|
gtk_window_update_csd_size (window,
|
|
|
|
|
&width, &height,
|
|
|
|
|
EXCLUDE_CSD_SIZE);
|
|
|
|
|
gtk_widget_allocate (widget, width, height, -1, NULL);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
gtk_widget_ensure_allocate (widget);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-06 18:30:34 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_root_interface_init (GtkRootInterface *iface)
|
|
|
|
|
{
|
2018-07-29 02:11:14 +00:00
|
|
|
|
iface->get_display = gtk_window_root_get_display;
|
2019-04-09 13:22:19 +00:00
|
|
|
|
iface->get_constraint_solver = gtk_window_root_get_constraint_solver;
|
2020-03-29 19:19:23 +00:00
|
|
|
|
iface->get_focus = gtk_window_root_get_focus;
|
|
|
|
|
iface->set_focus = gtk_window_root_set_focus;
|
2018-04-06 18:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-05-26 17:43:46 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_native_interface_init (GtkNativeInterface *iface)
|
|
|
|
|
{
|
|
|
|
|
iface->get_surface = gtk_window_native_get_surface;
|
|
|
|
|
iface->get_renderer = gtk_window_native_get_renderer;
|
|
|
|
|
iface->get_surface_transform = gtk_window_native_get_surface_transform;
|
2020-12-02 10:59:23 +00:00
|
|
|
|
iface->layout = gtk_window_native_layout;
|
2019-05-26 17:43:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-02-03 01:09:41 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_new:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*
|
|
|
|
|
* Creates a new `GtkWindow`.
|
2001-03-07 21:10:44 +00:00
|
|
|
|
*
|
2020-02-14 19:55:36 +00:00
|
|
|
|
* To get an undecorated window (no window borders), use
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* [method@Gtk.Window.set_decorated].
|
2011-12-10 22:29:16 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* All top-level windows created by gtk_window_new() are stored
|
|
|
|
|
* in an internal top-level window list. This list can be obtained
|
|
|
|
|
* from [func@Gtk.Window.list_toplevels]. Due to GTK keeping a
|
|
|
|
|
* reference to the window internally, gtk_window_new() does not
|
|
|
|
|
* return a reference to the caller.
|
2011-12-10 22:29:16 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* To delete a `GtkWindow`, call [method@Gtk.Window.destroy].
|
|
|
|
|
*
|
|
|
|
|
* Returns: a new `GtkWindow`.
|
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
GtkWidget*
|
2020-02-14 19:55:36 +00:00
|
|
|
|
gtk_window_new (void)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2020-02-14 19:55:36 +00:00
|
|
|
|
return g_object_new (GTK_TYPE_WINDOW, NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-02-03 01:09:41 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_title: (attributes org.gtk.Method.set_property=title)
|
|
|
|
|
* @window: a `GtkWindow`
|
2020-11-30 17:42:39 +00:00
|
|
|
|
* @title: (nullable): title of the window
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets the title of the `GtkWindow`.
|
|
|
|
|
*
|
|
|
|
|
* The title of a window will be displayed in its title bar; on the
|
|
|
|
|
* X Window System, the title bar is rendered by the window manager
|
|
|
|
|
* so exactly how the title appears to users may vary according to a
|
|
|
|
|
* user’s exact configuration. The title should help a user distinguish
|
|
|
|
|
* this window from other windows they may have open. A good title might
|
|
|
|
|
* include the application name and current document filename, for example.
|
|
|
|
|
*
|
2020-11-27 14:57:55 +00:00
|
|
|
|
* Passing %NULL does the same as setting the title to an empty string.
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
void
|
2020-11-27 14:57:55 +00:00
|
|
|
|
gtk_window_set_title (GtkWindow *window,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *title)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2020-04-30 23:04:08 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
char *new_title;
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2020-04-30 23:04:08 +00:00
|
|
|
|
new_title = g_strdup (title);
|
|
|
|
|
g_free (priv->title);
|
|
|
|
|
priv->title = new_title;
|
|
|
|
|
|
|
|
|
|
if (_gtk_widget_get_realized (GTK_WIDGET (window)))
|
|
|
|
|
gdk_toplevel_set_title (GDK_TOPLEVEL (priv->surface), new_title != NULL ? new_title : "");
|
|
|
|
|
|
2020-11-11 17:51:56 +00:00
|
|
|
|
gtk_accessible_update_property (GTK_ACCESSIBLE (window),
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_LABEL, priv->title,
|
|
|
|
|
-1);
|
|
|
|
|
|
2020-04-30 23:04:08 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_TITLE]);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_title: (attributes org.gtk.Method.get_property=title)
|
|
|
|
|
* @window: a `GtkWindow`
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Retrieves the title of the window.
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2015-11-08 16:17:00 +00:00
|
|
|
|
* Returns: (nullable): the title of the window, or %NULL if none has
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* been set explicitly. The returned string is owned by the widget
|
|
|
|
|
* and must not be modified or freed.
|
|
|
|
|
*/
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *
|
2001-06-24 15:34:48 +00:00
|
|
|
|
gtk_window_get_title (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->title;
|
2001-06-24 15:34:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-03-13 17:03:54 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_startup_id: (attributes org.gtk.Method.set_property=startup-id)
|
|
|
|
|
* @window: a `GtkWindow`
|
2007-03-13 17:03:54 +00:00
|
|
|
|
* @startup_id: a string with startup-notification identifier
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Sets the startup notification ID.
|
|
|
|
|
*
|
|
|
|
|
* Startup notification identifiers are used by desktop environment
|
|
|
|
|
* to track application startup, to provide user feedback and other
|
2007-03-13 17:03:54 +00:00
|
|
|
|
* features. This function changes the corresponding property on the
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* underlying `GdkSurface`.
|
|
|
|
|
*
|
|
|
|
|
* Normally, startup identifier is managed automatically and you should
|
|
|
|
|
* only use this function in special cases like transferring focus from
|
|
|
|
|
* other processes. You should use this function before calling
|
|
|
|
|
* [method@Gtk.Window.present] or any equivalent function generating
|
|
|
|
|
* a window map event.
|
2007-03-13 17:03:54 +00:00
|
|
|
|
*
|
2020-09-12 16:01:04 +00:00
|
|
|
|
* This function is only useful on X11, not with other GTK targets.
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*/
|
2007-03-13 17:03:54 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_set_startup_id (GtkWindow *window,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *startup_id)
|
2007-03-13 17:03:54 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-08-15 14:49:55 +00:00
|
|
|
|
GtkWidget *widget;
|
2007-03-13 17:03:54 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
2010-03-02 04:19:28 +00:00
|
|
|
|
|
2010-08-15 14:49:55 +00:00
|
|
|
|
widget = GTK_WIDGET (window);
|
|
|
|
|
|
2007-03-13 17:03:54 +00:00
|
|
|
|
g_free (priv->startup_id);
|
|
|
|
|
priv->startup_id = g_strdup (startup_id);
|
2009-04-07 13:39:00 +00:00
|
|
|
|
|
2015-09-06 23:58:03 +00:00
|
|
|
|
if (_gtk_widget_get_realized (widget))
|
2007-03-13 17:03:54 +00:00
|
|
|
|
{
|
2009-04-07 13:39:00 +00:00
|
|
|
|
guint32 timestamp = extract_time_from_startup_id (priv->startup_id);
|
|
|
|
|
|
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
2019-05-20 00:38:08 +00:00
|
|
|
|
if (timestamp != GDK_CURRENT_TIME && GDK_IS_X11_SURFACE (priv->surface))
|
|
|
|
|
gdk_x11_surface_set_user_time (priv->surface, timestamp);
|
2009-04-07 13:39:00 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2007-03-13 17:03:54 +00:00
|
|
|
|
/* Here we differentiate real and "fake" startup notification IDs,
|
|
|
|
|
* constructed on purpose just to pass interaction timestamp
|
2009-04-07 13:39:00 +00:00
|
|
|
|
*/
|
2007-03-13 17:03:54 +00:00
|
|
|
|
if (startup_id_is_fake (priv->startup_id))
|
2009-04-07 13:39:00 +00:00
|
|
|
|
gtk_window_present_with_time (window, timestamp);
|
2017-11-17 03:45:04 +00:00
|
|
|
|
else
|
2007-03-13 17:03:54 +00:00
|
|
|
|
{
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_set_startup_id (GDK_TOPLEVEL (priv->surface), priv->startup_id);
|
2017-11-17 03:45:04 +00:00
|
|
|
|
|
2007-03-13 17:03:54 +00:00
|
|
|
|
/* If window is mapped, terminate the startup-notification too */
|
2017-11-17 03:45:04 +00:00
|
|
|
|
if (_gtk_widget_get_mapped (widget) && !disable_startup_notification)
|
|
|
|
|
gdk_display_notify_startup_complete (gtk_widget_get_display (widget), priv->startup_id);
|
2007-03-13 17:03:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_STARTUP_ID]);
|
2007-03-13 17:03:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-02-03 01:09:41 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_default_widget: (attributes org.gtk.Property.set=default-widget)
|
|
|
|
|
* @window: a `GtkWindow`
|
2014-03-03 23:13:24 +00:00
|
|
|
|
* @default_widget: (allow-none): widget to be the default, or %NULL
|
|
|
|
|
* to unset the default widget for the toplevel
|
2001-02-03 01:09:41 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Sets the default widget.
|
|
|
|
|
*
|
|
|
|
|
* The default widget is the widget that is activated when the user
|
|
|
|
|
* presses Enter in a dialog (for example).
|
2014-03-03 23:13:24 +00:00
|
|
|
|
*/
|
1997-11-24 22:37:52 +00:00
|
|
|
|
void
|
2019-04-28 19:15:11 +00:00
|
|
|
|
gtk_window_set_default_widget (GtkWindow *window,
|
|
|
|
|
GtkWidget *default_widget)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (priv->default_widget != default_widget)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2001-11-17 01:18:49 +00:00
|
|
|
|
GtkWidget *old_default_widget = NULL;
|
2019-04-28 16:45:22 +00:00
|
|
|
|
|
2001-11-17 01:18:49 +00:00
|
|
|
|
if (default_widget)
|
|
|
|
|
g_object_ref (default_widget);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
|
|
|
|
if (priv->default_widget)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-17 13:37:57 +00:00
|
|
|
|
old_default_widget = priv->default_widget;
|
|
|
|
|
|
|
|
|
|
if (priv->focus_widget != priv->default_widget ||
|
|
|
|
|
!gtk_widget_get_receives_default (priv->default_widget))
|
|
|
|
|
_gtk_widget_set_has_default (priv->default_widget, FALSE);
|
|
|
|
|
|
|
|
|
|
gtk_widget_queue_draw (priv->default_widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
priv->default_widget = default_widget;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (priv->default_widget)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (priv->focus_widget == NULL ||
|
|
|
|
|
!gtk_widget_get_receives_default (priv->focus_widget))
|
|
|
|
|
_gtk_widget_set_has_default (priv->default_widget, TRUE);
|
|
|
|
|
|
|
|
|
|
gtk_widget_queue_draw (priv->default_widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
2001-11-17 01:18:49 +00:00
|
|
|
|
|
|
|
|
|
if (old_default_widget)
|
2005-03-26 05:49:15 +00:00
|
|
|
|
g_object_notify (G_OBJECT (old_default_widget), "has-default");
|
2019-04-28 16:45:22 +00:00
|
|
|
|
|
2001-11-17 01:18:49 +00:00
|
|
|
|
if (default_widget)
|
|
|
|
|
{
|
2005-03-26 05:49:15 +00:00
|
|
|
|
g_object_notify (G_OBJECT (default_widget), "has-default");
|
2001-11-17 01:18:49 +00:00
|
|
|
|
g_object_unref (default_widget);
|
|
|
|
|
}
|
2019-04-28 16:45:22 +00:00
|
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_DEFAULT_WIDGET]);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-06-20 11:02:08 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_default_widget: (attributes org.gtk.Property.get=default-widget)
|
|
|
|
|
* @window: a `GtkWindow`
|
2008-06-20 11:02:08 +00:00
|
|
|
|
*
|
2020-08-05 01:17:49 +00:00
|
|
|
|
* Returns the default widget for @window.
|
|
|
|
|
*
|
2015-11-08 16:17:00 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): the default widget, or %NULL
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* if there is none.
|
|
|
|
|
*/
|
2008-06-20 11:02:08 +00:00
|
|
|
|
GtkWidget *
|
2008-08-02 04:29:47 +00:00
|
|
|
|
gtk_window_get_default_widget (GtkWindow *window)
|
2008-06-20 11:02:08 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2008-06-20 11:02:08 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->default_widget;
|
2008-06-20 11:02:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
static gboolean
|
2001-11-20 23:43:03 +00:00
|
|
|
|
handle_keys_changed (gpointer data)
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
{
|
2010-08-17 13:37:57 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (data);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (priv->keys_changed_handler)
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
{
|
2010-08-17 13:37:57 +00:00
|
|
|
|
g_source_remove (priv->keys_changed_handler);
|
|
|
|
|
priv->keys_changed_handler = 0;
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-11-20 23:43:03 +00:00
|
|
|
|
g_signal_emit (window, window_signals[KEYS_CHANGED], 0);
|
2001-11-13 18:52:25 +00:00
|
|
|
|
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-10 03:44:51 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_window_notify_keys_changed (GtkWindow *window)
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
|
|
|
|
if (!priv->keys_changed_handler)
|
2014-03-22 11:44:01 +00:00
|
|
|
|
{
|
2018-02-02 14:08:02 +00:00
|
|
|
|
priv->keys_changed_handler = g_idle_add (handle_keys_changed, window);
|
2019-02-05 10:26:20 +00:00
|
|
|
|
g_source_set_name_by_id (priv->keys_changed_handler, "[gtk] handle_keys_changed");
|
2014-03-22 11:44:01 +00:00
|
|
|
|
}
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-31 20:41:02 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_focus: (attributes org.gtk.Property.get=focus-widget)
|
|
|
|
|
* @window: a `GtkWindow`
|
|
|
|
|
*
|
2001-10-31 20:41:02 +00:00
|
|
|
|
* Retrieves the current focused widget within the window.
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*
|
2001-10-31 20:41:02 +00:00
|
|
|
|
* Note that this is the widget that would have the focus
|
|
|
|
|
* if the toplevel window focused; if the toplevel window
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* is not focused then `gtk_widget_has_focus (widget)` will
|
2009-12-10 10:23:40 +00:00
|
|
|
|
* not be %TRUE for the widget.
|
|
|
|
|
*
|
2015-11-08 16:17:00 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): the currently focused widget,
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* or %NULL if there is none.
|
|
|
|
|
*/
|
2001-10-31 20:41:02 +00:00
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_window_get_focus (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2014-08-02 09:28:03 +00:00
|
|
|
|
|
2001-10-31 20:41:02 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
|
|
|
|
|
|
2020-03-30 03:38:34 +00:00
|
|
|
|
return priv->focus_widget;
|
2001-10-31 20:41:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-04-28 18:41:43 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_real_activate_default (GtkWindow *window)
|
1998-01-30 23:47:09 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
|
|
|
|
if (priv->default_widget && gtk_widget_is_sensitive (priv->default_widget) &&
|
|
|
|
|
(!priv->focus_widget || !gtk_widget_get_receives_default (priv->focus_widget)))
|
2019-04-28 18:41:43 +00:00
|
|
|
|
gtk_widget_activate (priv->default_widget);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
else if (priv->focus_widget && gtk_widget_is_sensitive (priv->focus_widget))
|
2019-04-28 18:41:43 +00:00
|
|
|
|
gtk_widget_activate (priv->focus_widget);
|
1997-12-18 02:17:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-02-03 01:09:41 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_modal: (attributes org.gtk.Method.set_property=modal)
|
|
|
|
|
* @window: a `GtkWindow`
|
2001-02-03 01:09:41 +00:00
|
|
|
|
* @modal: whether the window is modal
|
2020-07-27 22:25:37 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Sets a window modal or non-modal.
|
|
|
|
|
*
|
|
|
|
|
* Modal windows prevent interaction with other windows in the same
|
|
|
|
|
* application. To keep modal dialogs on top of main application windows,
|
|
|
|
|
* use [method@Gtk.Window.set_transient_for] to make the dialog transient
|
|
|
|
|
* for the parent; most window managers will then disallow lowering the
|
|
|
|
|
* dialog below the parent.
|
|
|
|
|
*/
|
1998-08-11 19:06:18 +00:00
|
|
|
|
void
|
1999-02-20 19:00:53 +00:00
|
|
|
|
gtk_window_set_modal (GtkWindow *window,
|
2020-07-27 22:25:37 +00:00
|
|
|
|
gboolean modal)
|
1998-08-11 19:06:18 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-03-01 06:47:38 +00:00
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
1998-08-11 19:06:18 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2002-12-16 00:05:26 +00:00
|
|
|
|
modal = modal != FALSE;
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (priv->modal == modal)
|
2002-12-16 00:05:26 +00:00
|
|
|
|
return;
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
|
|
|
|
priv->modal = modal;
|
2010-03-01 06:47:38 +00:00
|
|
|
|
widget = GTK_WIDGET (window);
|
2020-07-27 22:25:37 +00:00
|
|
|
|
|
2015-09-06 23:58:03 +00:00
|
|
|
|
if (_gtk_widget_get_realized (widget))
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_set_modal (GDK_TOPLEVEL (priv->surface), modal);
|
2002-12-16 00:05:26 +00:00
|
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
|
if (gtk_widget_get_visible (widget))
|
2002-12-16 00:05:26 +00:00
|
|
|
|
{
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (priv->modal)
|
2020-07-27 22:25:37 +00:00
|
|
|
|
gtk_grab_add (widget);
|
2002-12-16 00:05:26 +00:00
|
|
|
|
else
|
2020-07-27 22:25:37 +00:00
|
|
|
|
gtk_grab_remove (widget);
|
2002-12-16 00:05:26 +00:00
|
|
|
|
}
|
2001-03-12 21:01:53 +00:00
|
|
|
|
|
2020-04-22 17:32:10 +00:00
|
|
|
|
update_window_actions (window);
|
2016-05-31 13:25:52 +00:00
|
|
|
|
|
2020-07-27 22:25:37 +00:00
|
|
|
|
gtk_accessible_update_property (GTK_ACCESSIBLE (window),
|
|
|
|
|
GTK_ACCESSIBLE_PROPERTY_MODAL, modal,
|
|
|
|
|
-1);
|
|
|
|
|
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_MODAL]);
|
1998-08-11 19:06:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_modal: (attributes org.gtk.Method.get_property=modal)
|
|
|
|
|
* @window: a `GtkWindow`
|
|
|
|
|
*
|
|
|
|
|
* Returns whether the window is modal.
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the window is set to be modal and
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* establishes a grab when shown
|
|
|
|
|
*/
|
2001-06-24 15:34:48 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_window_get_modal (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->modal;
|
2001-06-24 15:34:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-08-27 06:37:16 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_get_toplevels:
|
|
|
|
|
*
|
|
|
|
|
* Returns a list of all existing toplevel windows.
|
|
|
|
|
*
|
|
|
|
|
* If you want to iterate through the list and perform actions involving
|
|
|
|
|
* callbacks that might destroy the widgets or add new ones, be aware that
|
|
|
|
|
* the list of toplevels will change and emit the "items-changed" signal.
|
|
|
|
|
*
|
2020-04-28 12:24:06 +00:00
|
|
|
|
* Returns: (transfer none) (attributes element-type=GtkWindow): the list
|
|
|
|
|
* of toplevel widgets
|
2018-08-27 06:37:16 +00:00
|
|
|
|
*/
|
|
|
|
|
GListModel *
|
|
|
|
|
gtk_window_get_toplevels (void)
|
|
|
|
|
{
|
|
|
|
|
if (toplevel_list == NULL)
|
|
|
|
|
toplevel_list = g_list_store_new (GTK_TYPE_WIDGET);
|
|
|
|
|
|
|
|
|
|
return G_LIST_MODEL (toplevel_list);
|
|
|
|
|
}
|
|
|
|
|
|
2001-02-03 01:09:41 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_list_toplevels:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*
|
|
|
|
|
* Returns a list of all existing toplevel windows.
|
|
|
|
|
*
|
|
|
|
|
* The widgets in the list are not individually referenced.
|
|
|
|
|
* If you want to iterate through the list and perform actions
|
|
|
|
|
* involving callbacks that might destroy the widgets, you must
|
|
|
|
|
* call `g_list_foreach (result, (GFunc)g_object_ref, NULL)` first,
|
|
|
|
|
* and then unref all the widgets afterwards.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (element-type GtkWidget) (transfer container): list of
|
|
|
|
|
* toplevel widgets
|
|
|
|
|
*/
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
GList*
|
|
|
|
|
gtk_window_list_toplevels (void)
|
|
|
|
|
{
|
2018-08-27 06:37:16 +00:00
|
|
|
|
GListModel *toplevels;
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
GList *list = NULL;
|
2018-08-27 06:37:16 +00:00
|
|
|
|
guint i;
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
|
2018-08-27 06:37:16 +00:00
|
|
|
|
toplevels = gtk_window_get_toplevels ();
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < g_list_model_get_n_items (toplevels); i++)
|
|
|
|
|
{
|
|
|
|
|
gpointer item = g_list_model_get_item (toplevels, i);
|
|
|
|
|
list = g_list_prepend (list, item);
|
|
|
|
|
g_object_unref (item);
|
|
|
|
|
}
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
1998-06-24 06:25:14 +00:00
|
|
|
|
static void
|
2001-07-02 05:03:21 +00:00
|
|
|
|
gtk_window_dispose (GObject *object)
|
1998-06-24 06:25:14 +00:00
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (object);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-05-05 20:51:24 +00:00
|
|
|
|
|
|
|
|
|
gtk_window_release_application (window);
|
|
|
|
|
|
|
|
|
|
if (priv->transient_parent)
|
|
|
|
|
gtk_window_set_transient_for (window, NULL);
|
|
|
|
|
|
|
|
|
|
if (priv->group)
|
|
|
|
|
gtk_window_group_remove_window (priv->group, window);
|
1998-06-24 06:25:14 +00:00
|
|
|
|
|
2017-07-19 16:13:47 +00:00
|
|
|
|
g_list_free_full (priv->foci, (GDestroyNotify) gtk_pointer_focus_unref);
|
|
|
|
|
priv->foci = NULL;
|
|
|
|
|
|
1998-06-24 06:25:14 +00:00
|
|
|
|
gtk_window_set_focus (window, NULL);
|
2019-04-28 19:15:11 +00:00
|
|
|
|
gtk_window_set_default_widget (window, NULL);
|
2012-01-12 18:29:52 +00:00
|
|
|
|
|
2020-05-02 19:17:20 +00:00
|
|
|
|
g_clear_pointer (&priv->child, gtk_widget_unparent);
|
2015-11-25 17:06:53 +00:00
|
|
|
|
unset_titlebar (window);
|
2020-05-02 19:17:20 +00:00
|
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (gtk_window_parent_class)->dispose (object);
|
1998-06-24 06:25:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-20 23:14:41 +00:00
|
|
|
|
static void
|
2020-05-09 16:03:11 +00:00
|
|
|
|
gtk_window_transient_parent_destroyed (GtkWindow *parent,
|
|
|
|
|
GtkWindow *window)
|
2000-10-20 23:14:41 +00:00
|
|
|
|
{
|
2020-05-09 16:03:11 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (GTK_WINDOW (window));
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
2020-05-09 16:03:11 +00:00
|
|
|
|
if (priv->destroy_with_parent)
|
2020-05-09 14:33:02 +00:00
|
|
|
|
gtk_window_destroy (window);
|
2020-05-09 16:03:11 +00:00
|
|
|
|
else
|
|
|
|
|
priv->transient_parent = NULL;
|
2000-10-20 23:14:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
1998-12-07 06:37:27 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_transient_parent_realized (GtkWidget *parent,
|
2020-05-09 16:03:11 +00:00
|
|
|
|
GtkWidget *window)
|
1998-12-07 06:37:27 +00:00
|
|
|
|
{
|
2019-05-20 00:38:08 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (GTK_WINDOW (window));
|
|
|
|
|
GtkWindowPrivate *parent_priv = gtk_window_get_instance_private (GTK_WINDOW (parent));
|
2015-09-06 23:58:03 +00:00
|
|
|
|
if (_gtk_widget_get_realized (window))
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_set_transient_for (GDK_TOPLEVEL (priv->surface), parent_priv->surface);
|
1998-12-07 06:37:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_window_transient_parent_unrealized (GtkWidget *parent,
|
2020-05-09 16:03:11 +00:00
|
|
|
|
GtkWidget *window)
|
1998-12-07 06:37:27 +00:00
|
|
|
|
{
|
2019-05-20 00:38:08 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (GTK_WINDOW (window));
|
2015-09-06 23:58:03 +00:00
|
|
|
|
if (_gtk_widget_get_realized (window))
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_set_transient_for (GDK_TOPLEVEL (priv->surface), NULL);
|
1998-12-07 06:37:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-10-22 19:54:40 +00:00
|
|
|
|
static void
|
2020-05-09 16:03:11 +00:00
|
|
|
|
gtk_window_transient_parent_display_changed (GtkWindow *parent,
|
2017-10-31 06:41:15 +00:00
|
|
|
|
GParamSpec *pspec,
|
|
|
|
|
GtkWindow *window)
|
2002-10-22 19:54:40 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *parent_priv = gtk_window_get_instance_private (parent);
|
|
|
|
|
|
|
|
|
|
gtk_window_set_display (window, parent_priv->display);
|
2002-10-22 19:54:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-05-09 16:03:11 +00:00
|
|
|
|
static void
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gtk_window_unset_transient_for (GtkWindow *window)
|
1998-12-07 06:37:27 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
|
|
|
|
if (priv->transient_parent)
|
1998-12-07 06:37:27 +00:00
|
|
|
|
{
|
2010-08-17 13:37:57 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->transient_parent,
|
2020-05-09 16:03:11 +00:00
|
|
|
|
gtk_window_transient_parent_realized,
|
|
|
|
|
window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->transient_parent,
|
2020-05-09 16:03:11 +00:00
|
|
|
|
gtk_window_transient_parent_unrealized,
|
|
|
|
|
window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->transient_parent,
|
2020-05-09 16:03:11 +00:00
|
|
|
|
gtk_window_transient_parent_display_changed,
|
|
|
|
|
window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->transient_parent,
|
2020-05-09 16:03:11 +00:00
|
|
|
|
gtk_window_transient_parent_destroyed,
|
|
|
|
|
window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
|
|
|
|
priv->transient_parent = NULL;
|
2008-08-01 03:30:50 +00:00
|
|
|
|
|
|
|
|
|
if (priv->transient_parent_group)
|
2020-05-09 16:03:11 +00:00
|
|
|
|
{
|
|
|
|
|
priv->transient_parent_group = FALSE;
|
|
|
|
|
gtk_window_group_remove_window (priv->group, window);
|
|
|
|
|
}
|
1998-12-07 06:37:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-02-03 01:09:41 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_transient_for: (attributes org.gtk.Method.set_property=transient-for)
|
|
|
|
|
* @window: a `GtkWindow`
|
2010-03-09 02:22:54 +00:00
|
|
|
|
* @parent: (allow-none): parent window, or %NULL
|
2001-02-03 01:09:41 +00:00
|
|
|
|
*
|
|
|
|
|
* Dialog windows should be set transient for the main application
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* window they were spawned from. This allows window managers to e.g.
|
|
|
|
|
* keep the dialog on top of the main window, or center the dialog
|
|
|
|
|
* over the main window. [ctor@Gtk.Dialog.new_with_buttons] and other
|
|
|
|
|
* convenience functions in GTK will sometimes call
|
2001-03-07 21:10:44 +00:00
|
|
|
|
* gtk_window_set_transient_for() on your behalf.
|
2002-01-19 18:51:48 +00:00
|
|
|
|
*
|
2010-03-09 02:22:54 +00:00
|
|
|
|
* Passing %NULL for @parent unsets the current transient window.
|
|
|
|
|
*
|
|
|
|
|
* On Windows, this function puts the child window on top of the parent,
|
2007-05-18 15:32:54 +00:00
|
|
|
|
* much as the window manager would have done on X.
|
2010-03-09 02:22:54 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2020-05-09 16:03:11 +00:00
|
|
|
|
gtk_window_set_transient_for (GtkWindow *window,
|
|
|
|
|
GtkWindow *parent)
|
1998-12-07 06:37:27 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
2000-10-20 23:14:41 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
g_return_if_fail (parent == NULL || GTK_IS_WINDOW (parent));
|
|
|
|
|
g_return_if_fail (window != parent);
|
1998-12-07 06:37:27 +00:00
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (priv->transient_parent)
|
1998-12-07 06:37:27 +00:00
|
|
|
|
{
|
2015-09-06 23:58:03 +00:00
|
|
|
|
if (_gtk_widget_get_realized (GTK_WIDGET (window)) &&
|
|
|
|
|
_gtk_widget_get_realized (GTK_WIDGET (priv->transient_parent)) &&
|
|
|
|
|
(!parent || !_gtk_widget_get_realized (GTK_WIDGET (parent))))
|
2020-05-09 16:03:11 +00:00
|
|
|
|
gtk_window_transient_parent_unrealized (GTK_WIDGET (priv->transient_parent),
|
|
|
|
|
GTK_WIDGET (window));
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
gtk_window_unset_transient_for (window);
|
1998-12-07 06:37:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
priv->transient_parent = parent;
|
|
|
|
|
|
1998-12-07 06:37:27 +00:00
|
|
|
|
if (parent)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *parent_priv = gtk_window_get_instance_private (parent);
|
2002-10-01 19:55:08 +00:00
|
|
|
|
g_signal_connect (parent, "realize",
|
2020-05-09 16:03:11 +00:00
|
|
|
|
G_CALLBACK (gtk_window_transient_parent_realized), window);
|
2002-10-01 19:55:08 +00:00
|
|
|
|
g_signal_connect (parent, "unrealize",
|
2020-05-09 16:03:11 +00:00
|
|
|
|
G_CALLBACK (gtk_window_transient_parent_unrealized), window);
|
2017-10-31 06:41:15 +00:00
|
|
|
|
g_signal_connect (parent, "notify::display",
|
2020-05-09 16:03:11 +00:00
|
|
|
|
G_CALLBACK (gtk_window_transient_parent_display_changed), window);
|
|
|
|
|
g_signal_connect (parent, "destroy",
|
|
|
|
|
G_CALLBACK (gtk_window_transient_parent_destroyed), window);
|
2010-09-28 17:13:24 +00:00
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
gtk_window_set_display (window, parent_priv->display);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
2020-05-09 16:03:11 +00:00
|
|
|
|
|
2015-09-06 23:58:03 +00:00
|
|
|
|
if (_gtk_widget_get_realized (GTK_WIDGET (window)) &&
|
2020-05-09 16:03:11 +00:00
|
|
|
|
_gtk_widget_get_realized (GTK_WIDGET (parent)))
|
|
|
|
|
gtk_window_transient_parent_realized (GTK_WIDGET (parent), GTK_WIDGET (window));
|
2005-08-31 04:41:45 +00:00
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
if (parent_priv->group)
|
2020-05-09 16:03:11 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_window_group_add_window (parent_priv->group, window);
|
|
|
|
|
priv->transient_parent_group = TRUE;
|
|
|
|
|
}
|
1998-12-07 06:37:27 +00:00
|
|
|
|
}
|
2016-05-31 13:25:52 +00:00
|
|
|
|
|
2020-04-22 17:32:10 +00:00
|
|
|
|
update_window_actions (window);
|
2018-11-19 21:07:17 +00:00
|
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_TRANSIENT_FOR]);
|
1998-12-07 06:37:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_transient_for: (attributes org.gtk.Method.get_property=transient-for)
|
|
|
|
|
* @window: a `GtkWindow`
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Fetches the transient parent for this window.
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2015-11-08 16:17:00 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): the transient parent for this
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* window, or %NULL if no transient parent has been set.
|
|
|
|
|
*/
|
2001-06-24 15:34:48 +00:00
|
|
|
|
GtkWindow *
|
|
|
|
|
gtk_window_get_transient_for (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->transient_parent;
|
2001-06-24 15:34:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-11 05:23:23 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_application: (attributes org.gtk.Method.get_property=application)
|
|
|
|
|
* @window: a `GtkWindow`
|
2010-08-11 05:23:23 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Gets the `GtkApplication` associated with the window.
|
2010-08-11 05:23:23 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): a `GtkApplication`, or %NULL
|
|
|
|
|
*/
|
2010-08-11 05:23:23 +00:00
|
|
|
|
GtkApplication *
|
|
|
|
|
gtk_window_get_application (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2010-08-11 05:23:23 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->application;
|
2010-08-11 05:23:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_window_release_application (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
if (priv->application)
|
2010-08-11 05:23:23 +00:00
|
|
|
|
{
|
2010-10-19 19:10:02 +00:00
|
|
|
|
GtkApplication *application;
|
2010-08-11 05:23:23 +00:00
|
|
|
|
|
2010-10-19 19:10:02 +00:00
|
|
|
|
/* steal reference into temp variable */
|
2018-06-18 19:50:33 +00:00
|
|
|
|
application = priv->application;
|
|
|
|
|
priv->application = NULL;
|
2018-08-22 23:23:24 +00:00
|
|
|
|
gtk_widget_remove_controller (GTK_WIDGET (window),
|
|
|
|
|
priv->application_shortcut_controller);
|
|
|
|
|
priv->application_shortcut_controller = NULL;
|
2010-10-19 19:10:02 +00:00
|
|
|
|
|
|
|
|
|
gtk_application_remove_window (application, window);
|
|
|
|
|
g_object_unref (application);
|
2010-08-11 05:23:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_application: (attributes org.gtk.Method.set_property=application)
|
|
|
|
|
* @window: a `GtkWindow`
|
|
|
|
|
* @application: (allow-none): a `GtkApplication`, or %NULL to unset
|
2010-08-11 05:23:23 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Sets or unsets the `GtkApplication` associated with the window.
|
2010-08-11 05:23:23 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* The application will be kept alive for at least as long as it has
|
|
|
|
|
* any windows associated with it (see g_application_hold() for a way
|
|
|
|
|
* to keep it alive without windows).
|
2017-09-18 23:05:09 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Normally, the connection between the application and the window will
|
|
|
|
|
* remain until the window is destroyed, but you can explicitly remove
|
|
|
|
|
* it by setting the @application to %NULL.
|
2017-09-18 23:05:09 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* This is equivalent to calling [method@Gtk.Application.remove_window]
|
|
|
|
|
* and/or [method@Gtk.Application.add_window] on the old/new applications
|
|
|
|
|
* as relevant.
|
|
|
|
|
*/
|
2010-08-11 05:23:23 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_set_application (GtkWindow *window,
|
|
|
|
|
GtkApplication *application)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-10-23 19:24:24 +00:00
|
|
|
|
|
2010-08-11 05:23:23 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2010-10-23 19:24:24 +00:00
|
|
|
|
if (priv->application != application)
|
2010-08-11 05:23:23 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_window_release_application (window);
|
|
|
|
|
|
2010-10-23 19:24:24 +00:00
|
|
|
|
priv->application = application;
|
2010-08-11 05:23:23 +00:00
|
|
|
|
|
2010-10-23 19:24:24 +00:00
|
|
|
|
if (priv->application != NULL)
|
2010-08-11 05:23:23 +00:00
|
|
|
|
{
|
2018-08-22 23:23:24 +00:00
|
|
|
|
GtkApplicationAccels *app_accels;
|
|
|
|
|
|
2010-10-23 19:24:24 +00:00
|
|
|
|
g_object_ref (priv->application);
|
2010-10-19 19:10:02 +00:00
|
|
|
|
|
2010-10-23 19:24:24 +00:00
|
|
|
|
gtk_application_add_window (priv->application, window);
|
2018-08-22 23:23:24 +00:00
|
|
|
|
|
|
|
|
|
app_accels = gtk_application_get_application_accels (priv->application);
|
|
|
|
|
priv->application_shortcut_controller = gtk_shortcut_controller_new_for_model (gtk_application_accels_get_shortcuts (app_accels));
|
|
|
|
|
gtk_event_controller_set_name (priv->application_shortcut_controller, "gtk-application-shortcuts");
|
|
|
|
|
gtk_event_controller_set_propagation_phase (priv->application_shortcut_controller, GTK_PHASE_CAPTURE);
|
|
|
|
|
gtk_shortcut_controller_set_scope (GTK_SHORTCUT_CONTROLLER (priv->application_shortcut_controller), GTK_SHORTCUT_SCOPE_GLOBAL);
|
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (window), priv->application_shortcut_controller);
|
2010-08-11 05:23:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-07-10 02:33:22 +00:00
|
|
|
|
_gtk_widget_update_parent_muxer (GTK_WIDGET (window));
|
2012-08-17 22:21:59 +00:00
|
|
|
|
|
2013-07-10 03:44:51 +00:00
|
|
|
|
_gtk_window_notify_keys_changed (window);
|
|
|
|
|
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_APPLICATION]);
|
2010-08-11 05:23:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-10-20 23:14:41 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_destroy_with_parent: (attributes org.gtk.Method.set_property=destroy-with-parent)
|
|
|
|
|
* @window: a `GtkWindow`
|
2000-10-20 23:14:41 +00:00
|
|
|
|
* @setting: whether to destroy @window with its transient parent
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*
|
2001-12-30 22:56:05 +00:00
|
|
|
|
* If @setting is %TRUE, then destroying the transient parent of @window
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* will also destroy @window itself.
|
|
|
|
|
*
|
|
|
|
|
* This is useful for dialogs that shouldn’t persist beyond the lifetime
|
|
|
|
|
* of the main window they are associated with, for example.
|
|
|
|
|
*/
|
2000-10-20 23:14:41 +00:00
|
|
|
|
void
|
2020-05-09 16:03:11 +00:00
|
|
|
|
gtk_window_set_destroy_with_parent (GtkWindow *window,
|
|
|
|
|
gboolean setting)
|
2000-10-20 23:14:41 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
2000-10-20 23:14:41 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (priv->destroy_with_parent == (setting != FALSE))
|
2000-10-20 23:14:41 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
priv->destroy_with_parent = setting;
|
2001-03-12 21:01:53 +00:00
|
|
|
|
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_DESTROY_WITH_PARENT]);
|
2000-10-20 23:14:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_destroy_with_parent: (attributes org.gtk.Method.get_property=destroy-with-parent)
|
|
|
|
|
* @window: a `GtkWindow`
|
|
|
|
|
*
|
|
|
|
|
* Returns whether the window will be destroyed with its transient parent.
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the window will be destroyed with its transient parent.
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*/
|
2001-06-24 15:34:48 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_window_get_destroy_with_parent (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->destroy_with_parent;
|
2001-06-24 15:34:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-12-31 15:42:10 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_hide_on_close: (attributes org.gtk.Method.set_property=hide-on-close)
|
|
|
|
|
* @window: a `GtkWindow`
|
2017-12-31 15:42:10 +00:00
|
|
|
|
* @setting: whether to hide the window when it is closed
|
|
|
|
|
*
|
|
|
|
|
* If @setting is %TRUE, then clicking the close button on the window
|
|
|
|
|
* will not destroy it, but only hide it.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_window_set_hide_on_close (GtkWindow *window,
|
|
|
|
|
gboolean setting)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2017-12-31 15:42:10 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
|
|
if (priv->hide_on_close == setting)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
priv->hide_on_close = setting;
|
|
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_HIDE_ON_CLOSE]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_hide_on_close: (attributes org.gtk.Method.get_property=hide-on-close)
|
|
|
|
|
* @window: a `GtkWindow`
|
2017-12-31 15:42:10 +00:00
|
|
|
|
*
|
|
|
|
|
* Returns whether the window will be hidden when the close button is clicked.
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE if the window will be hidden
|
|
|
|
|
*/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_window_get_hide_on_close (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2017-12-31 15:42:10 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->hide_on_close;
|
2017-12-31 15:42:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
static GtkWindowGeometryInfo*
|
|
|
|
|
gtk_window_get_geometry_info (GtkWindow *window,
|
|
|
|
|
gboolean create)
|
1998-12-07 06:37:27 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
1998-12-07 06:37:27 +00:00
|
|
|
|
GtkWindowGeometryInfo *info;
|
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
info = priv->geometry_info;
|
1998-12-07 06:37:27 +00:00
|
|
|
|
if (!info && create)
|
|
|
|
|
{
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
info = g_new0 (GtkWindowGeometryInfo, 1);
|
1998-12-07 06:37:27 +00:00
|
|
|
|
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
info->last.configure_request.x = 0;
|
|
|
|
|
info->last.configure_request.y = 0;
|
|
|
|
|
info->last.configure_request.width = -1;
|
|
|
|
|
info->last.configure_request.height = -1;
|
2010-08-17 13:37:57 +00:00
|
|
|
|
priv->geometry_info = info;
|
1998-12-07 06:37:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
|
2013-05-13 00:58:48 +00:00
|
|
|
|
static void
|
|
|
|
|
unset_titlebar (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2013-05-13 00:58:48 +00:00
|
|
|
|
|
|
|
|
|
if (priv->title_box != NULL)
|
|
|
|
|
{
|
|
|
|
|
gtk_widget_unparent (priv->title_box);
|
|
|
|
|
priv->title_box = NULL;
|
2013-08-21 18:59:44 +00:00
|
|
|
|
priv->titlebar = NULL;
|
2013-05-13 00:58:48 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-21 19:08:08 +00:00
|
|
|
|
static gboolean
|
2015-03-11 12:52:21 +00:00
|
|
|
|
gtk_window_supports_client_shadow (GtkWindow *window)
|
2013-08-21 19:08:08 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2015-09-08 10:14:07 +00:00
|
|
|
|
GdkDisplay *display;
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
display = priv->display;
|
2013-08-21 19:08:08 +00:00
|
|
|
|
|
2016-10-29 02:37:20 +00:00
|
|
|
|
if (!gdk_display_is_rgba (display))
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
if (!gdk_display_is_composited (display))
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
2013-08-21 19:08:08 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
2015-09-08 10:14:07 +00:00
|
|
|
|
if (GDK_IS_X11_DISPLAY (display))
|
2013-08-21 19:08:08 +00:00
|
|
|
|
{
|
2017-11-01 22:40:51 +00:00
|
|
|
|
if (!gdk_x11_screen_supports_net_wm_hint (gdk_x11_display_get_screen (display),
|
2017-12-14 04:39:03 +00:00
|
|
|
|
g_intern_static_string ("_GTK_FRAME_EXTENTS")))
|
2015-03-10 00:48:47 +00:00
|
|
|
|
return FALSE;
|
2013-11-27 10:14:16 +00:00
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-08-21 19:08:08 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2014-06-04 10:38:20 +00:00
|
|
|
|
gtk_window_enable_csd (GtkWindow *window)
|
2013-08-21 19:08:08 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2013-08-21 19:08:08 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (window);
|
|
|
|
|
|
2015-03-11 12:52:21 +00:00
|
|
|
|
/* We need a visual with alpha for client shadows */
|
|
|
|
|
if (priv->use_client_shadow)
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (widget, "csd");
|
2015-03-11 12:52:21 +00:00
|
|
|
|
else
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_add_css_class (widget, "solid-csd");
|
2013-08-21 19:08:08 +00:00
|
|
|
|
|
|
|
|
|
priv->client_decorated = TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-18 12:48:15 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_set_titlebar:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2014-01-10 20:25:27 +00:00
|
|
|
|
* @titlebar: (allow-none): the widget to use as titlebar
|
2013-03-18 12:48:15 +00:00
|
|
|
|
*
|
|
|
|
|
* Sets a custom titlebar for @window.
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* A typical widget used here is [class@Gtk.HeaderBar], as it
|
|
|
|
|
* provides various features expected of a titlebar while allowing
|
|
|
|
|
* the addition of child widgets to it.
|
2018-01-12 21:26:36 +00:00
|
|
|
|
*
|
2020-09-12 16:01:04 +00:00
|
|
|
|
* If you set a custom titlebar, GTK will do its best to convince
|
2013-03-18 12:48:15 +00:00
|
|
|
|
* the window manager not to put its own titlebar on the window.
|
|
|
|
|
* Depending on the system, this function may not work for a window
|
|
|
|
|
* that is already visible, so you set the titlebar before calling
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* [method@Gtk.Widget.show].
|
2013-03-18 12:48:15 +00:00
|
|
|
|
*/
|
2013-03-18 12:38:02 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_set_titlebar (GtkWindow *window,
|
|
|
|
|
GtkWidget *titlebar)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (window);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2014-01-24 19:32:00 +00:00
|
|
|
|
gboolean was_mapped;
|
2013-03-18 12:38:02 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2014-02-04 03:38:06 +00:00
|
|
|
|
if ((!priv->title_box && titlebar) || (priv->title_box && !titlebar))
|
|
|
|
|
{
|
2015-09-07 16:23:09 +00:00
|
|
|
|
was_mapped = _gtk_widget_get_mapped (widget);
|
2015-09-06 23:58:03 +00:00
|
|
|
|
if (_gtk_widget_get_realized (widget))
|
2014-02-04 03:38:06 +00:00
|
|
|
|
{
|
|
|
|
|
g_warning ("gtk_window_set_titlebar() called on a realized window");
|
|
|
|
|
gtk_widget_unrealize (widget);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
was_mapped = FALSE;
|
2014-01-24 19:32:00 +00:00
|
|
|
|
|
2013-05-13 00:58:48 +00:00
|
|
|
|
unset_titlebar (window);
|
2013-03-18 12:38:02 +00:00
|
|
|
|
|
2014-01-10 20:25:27 +00:00
|
|
|
|
if (titlebar == NULL)
|
|
|
|
|
{
|
|
|
|
|
priv->client_decorated = FALSE;
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_remove_css_class (widget, "csd");
|
2014-10-17 17:59:39 +00:00
|
|
|
|
|
|
|
|
|
goto out;
|
2014-01-10 20:25:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-03-11 12:52:21 +00:00
|
|
|
|
priv->use_client_shadow = gtk_window_supports_client_shadow (window);
|
2013-08-21 17:54:16 +00:00
|
|
|
|
|
2015-03-11 12:52:21 +00:00
|
|
|
|
gtk_window_enable_csd (window);
|
2013-03-18 12:38:02 +00:00
|
|
|
|
priv->title_box = titlebar;
|
2020-08-01 07:30:48 +00:00
|
|
|
|
gtk_widget_insert_before (priv->title_box, widget, NULL);
|
2013-03-18 12:38:02 +00:00
|
|
|
|
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (titlebar, "titlebar");
|
2013-08-16 17:26:12 +00:00
|
|
|
|
|
2014-10-17 17:59:39 +00:00
|
|
|
|
out:
|
2014-01-24 19:32:00 +00:00
|
|
|
|
if (was_mapped)
|
|
|
|
|
gtk_widget_map (widget);
|
2013-03-18 12:38:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-10-18 16:42:29 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_get_titlebar:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2014-10-18 16:42:29 +00:00
|
|
|
|
*
|
|
|
|
|
* Returns the custom titlebar that has been set with
|
|
|
|
|
* gtk_window_set_titlebar().
|
|
|
|
|
*
|
2015-11-08 16:17:00 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): the custom titlebar, or %NULL
|
2014-10-18 16:42:29 +00:00
|
|
|
|
*/
|
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_window_get_titlebar (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2014-10-18 16:42:29 +00:00
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
|
|
|
|
|
|
|
|
|
|
/* Don't return the internal titlebar */
|
|
|
|
|
if (priv->title_box == priv->titlebar)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
return priv->title_box;
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-07 21:10:44 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_decorated: (attributes org.gtk.Method.set_property=decorated)
|
|
|
|
|
* @window: a `GtkWindow`
|
2001-03-07 21:10:44 +00:00
|
|
|
|
* @setting: %TRUE to decorate the window
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Sets whether the window should be decorated.
|
|
|
|
|
*
|
2001-03-07 21:10:44 +00:00
|
|
|
|
* By default, windows are decorated with a title bar, resize
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* controls, etc. Some window managers allow GTK to disable these
|
|
|
|
|
* decorations, creating a borderless window. If you set the decorated
|
|
|
|
|
* property to %FALSE using this function, GTK will do its best to
|
|
|
|
|
* convince the window manager not to decorate the window. Depending on
|
|
|
|
|
* the system, this function may not have any effect when called on a
|
|
|
|
|
* window that is already visible, so you should call it before calling
|
|
|
|
|
* [method@Gtk.Widget.show].
|
2002-01-19 18:51:48 +00:00
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* On Windows, this function always works, since there’s no window manager
|
2002-01-19 18:51:48 +00:00
|
|
|
|
* policy involved.
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*/
|
2001-03-07 21:10:44 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_set_decorated (GtkWindow *window,
|
|
|
|
|
gboolean setting)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-08-15 14:49:55 +00:00
|
|
|
|
|
2001-03-07 21:10:44 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
|
|
setting = setting != FALSE;
|
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (setting == priv->decorated)
|
2001-03-07 21:10:44 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
priv->decorated = setting;
|
2010-08-15 14:49:55 +00:00
|
|
|
|
|
2019-05-20 00:38:08 +00:00
|
|
|
|
if (priv->surface)
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_set_decorated (GDK_TOPLEVEL (priv->surface), priv->decorated && !priv->client_decorated);
|
2003-07-18 22:00:20 +00:00
|
|
|
|
|
2020-04-22 17:32:10 +00:00
|
|
|
|
update_window_actions (window);
|
2013-03-10 03:28:39 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (window));
|
|
|
|
|
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_DECORATED]);
|
2001-03-07 21:10:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_decorated: (attributes org.gtk.Method.get_property=decorated)
|
|
|
|
|
* @window: a `GtkWindow`
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Returns whether the window has been set to have decorations.
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the window has been set to have decorations
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*/
|
2001-06-24 15:34:48 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_window_get_decorated (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), TRUE);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->decorated;
|
2001-06-24 15:34:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-08-30 04:46:09 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_deletable: (attributes org.gtk.Method.set_property=deletable)
|
|
|
|
|
* @window: a `GtkWindow`
|
2005-08-30 04:46:09 +00:00
|
|
|
|
* @setting: %TRUE to decorate the window as deletable
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Sets whether the window should be deletable.
|
2005-08-30 04:46:09 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* By default, windows have a close button in the window frame.
|
|
|
|
|
* Some window managers allow GTK to disable this button. If you
|
|
|
|
|
* set the deletable property to %FALSE using this function, GTK
|
|
|
|
|
* will do its best to convince the window manager not to show a
|
|
|
|
|
* close button. Depending on the system, this function may not
|
|
|
|
|
* have any effect when called on a window that is already visible,
|
|
|
|
|
* so you should call it before calling [method@Gtk.Widget.show].
|
|
|
|
|
*
|
|
|
|
|
* On Windows, this function always works, since there’s no window
|
|
|
|
|
* manager policy involved.
|
2005-08-30 04:46:09 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_window_set_deletable (GtkWindow *window,
|
|
|
|
|
gboolean setting)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2005-08-30 04:46:09 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
|
|
setting = setting != FALSE;
|
|
|
|
|
|
|
|
|
|
if (setting == priv->deletable)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
priv->deletable = setting;
|
2010-08-15 14:49:55 +00:00
|
|
|
|
|
2019-05-20 00:38:08 +00:00
|
|
|
|
if (priv->surface)
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_set_deletable (GDK_TOPLEVEL (priv->surface), priv->deletable);
|
2005-08-30 04:46:09 +00:00
|
|
|
|
|
2020-04-22 17:32:10 +00:00
|
|
|
|
update_window_actions (window);
|
2013-03-10 03:28:39 +00:00
|
|
|
|
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_DELETABLE]);
|
2005-08-30 04:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_deletable: (attributes org.gtk.Method.get_property=deletable)
|
|
|
|
|
* @window: a `GtkWindow`
|
2005-08-30 04:46:09 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Returns whether the window has been set to have a close button.
|
2005-08-30 04:46:09 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the window has been set to have a close button
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*/
|
2005-08-30 04:46:09 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_window_get_deletable (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2005-08-30 04:46:09 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), TRUE);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->deletable;
|
2005-08-30 04:46:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-08-29 02:20:02 +00:00
|
|
|
|
static GtkWindowIconInfo*
|
|
|
|
|
get_icon_info (GtkWindow *window)
|
|
|
|
|
{
|
2006-01-04 07:06:12 +00:00
|
|
|
|
return g_object_get_qdata (G_OBJECT (window), quark_gtk_window_icon_info);
|
2001-08-29 02:20:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-07-17 03:55:07 +00:00
|
|
|
|
static void
|
|
|
|
|
free_icon_info (GtkWindowIconInfo *info)
|
|
|
|
|
{
|
|
|
|
|
g_free (info->icon_name);
|
2006-01-04 07:06:12 +00:00
|
|
|
|
g_slice_free (GtkWindowIconInfo, info);
|
2004-07-17 03:55:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-08-29 02:20:02 +00:00
|
|
|
|
static GtkWindowIconInfo*
|
|
|
|
|
ensure_icon_info (GtkWindow *window)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowIconInfo *info;
|
|
|
|
|
|
|
|
|
|
info = get_icon_info (window);
|
|
|
|
|
|
|
|
|
|
if (info == NULL)
|
|
|
|
|
{
|
2006-01-04 07:06:12 +00:00
|
|
|
|
info = g_slice_new0 (GtkWindowIconInfo);
|
|
|
|
|
g_object_set_qdata_full (G_OBJECT (window),
|
|
|
|
|
quark_gtk_window_icon_info,
|
2001-08-29 02:20:02 +00:00
|
|
|
|
info,
|
2004-07-17 03:55:07 +00:00
|
|
|
|
(GDestroyNotify)free_icon_info);
|
2001-08-29 02:20:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-01 20:28:00 +00:00
|
|
|
|
static int
|
|
|
|
|
icon_size_compare (GdkTexture *a,
|
|
|
|
|
GdkTexture *b)
|
|
|
|
|
{
|
|
|
|
|
int area_a, area_b;
|
|
|
|
|
|
|
|
|
|
area_a = gdk_texture_get_width (a) * gdk_texture_get_height (a);
|
|
|
|
|
area_b = gdk_texture_get_width (b) * gdk_texture_get_height (b);
|
|
|
|
|
|
|
|
|
|
return area_a - area_b;
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-06 16:10:13 +00:00
|
|
|
|
static GdkTexture *
|
|
|
|
|
render_paintable_to_texture (GdkPaintable *paintable)
|
|
|
|
|
{
|
|
|
|
|
GtkSnapshot *snapshot;
|
|
|
|
|
GskRenderNode *node;
|
|
|
|
|
int width, height;
|
|
|
|
|
cairo_surface_t *surface;
|
|
|
|
|
cairo_t *cr;
|
|
|
|
|
GdkTexture *texture;
|
|
|
|
|
|
|
|
|
|
width = gdk_paintable_get_intrinsic_width (paintable);
|
|
|
|
|
height = gdk_paintable_get_intrinsic_height (paintable);
|
|
|
|
|
|
|
|
|
|
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
|
|
|
|
|
|
|
|
|
|
snapshot = gtk_snapshot_new ();
|
|
|
|
|
gdk_paintable_snapshot (paintable, snapshot, width, height);
|
|
|
|
|
node = gtk_snapshot_free_to_node (snapshot);
|
|
|
|
|
|
|
|
|
|
cr = cairo_create (surface);
|
|
|
|
|
gsk_render_node_draw (node, cr);
|
|
|
|
|
cairo_destroy (cr);
|
|
|
|
|
|
|
|
|
|
gsk_render_node_unref (node);
|
|
|
|
|
|
|
|
|
|
texture = gdk_texture_new_for_surface (surface);
|
|
|
|
|
cairo_surface_destroy (surface);
|
|
|
|
|
|
|
|
|
|
return texture;
|
|
|
|
|
}
|
|
|
|
|
|
2004-07-17 03:55:07 +00:00
|
|
|
|
static GList *
|
2015-09-11 13:09:10 +00:00
|
|
|
|
icon_list_from_theme (GtkWindow *window,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *name)
|
2004-07-17 03:55:07 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2004-07-17 03:55:07 +00:00
|
|
|
|
GList *list;
|
|
|
|
|
GtkIconTheme *icon_theme;
|
2020-02-04 16:19:22 +00:00
|
|
|
|
GtkIconPaintable *info;
|
2020-02-06 16:10:13 +00:00
|
|
|
|
GdkTexture *texture;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int *sizes;
|
|
|
|
|
int i;
|
2004-07-17 03:55:07 +00:00
|
|
|
|
|
2020-04-21 12:37:04 +00:00
|
|
|
|
icon_theme = gtk_icon_theme_get_for_display (priv->display);
|
2004-07-17 03:55:07 +00:00
|
|
|
|
|
|
|
|
|
sizes = gtk_icon_theme_get_icon_sizes (icon_theme, name);
|
|
|
|
|
|
2004-10-04 14:47:03 +00:00
|
|
|
|
list = NULL;
|
2004-07-17 03:55:07 +00:00
|
|
|
|
for (i = 0; sizes[i]; i++)
|
2015-09-11 13:09:10 +00:00
|
|
|
|
{
|
2004-10-04 14:47:03 +00:00
|
|
|
|
/* FIXME
|
2017-11-29 22:06:15 +00:00
|
|
|
|
* We need an EWMH extension to handle scalable icons
|
|
|
|
|
* by passing their name to the WM. For now just use a
|
2004-07-17 03:55:07 +00:00
|
|
|
|
* fixed size of 48.
|
2017-11-29 22:06:15 +00:00
|
|
|
|
*/
|
2004-07-17 03:55:07 +00:00
|
|
|
|
if (sizes[i] == -1)
|
2020-02-04 02:53:22 +00:00
|
|
|
|
info = gtk_icon_theme_lookup_icon (icon_theme, name, NULL,
|
2020-01-28 15:14:52 +00:00
|
|
|
|
48, priv->scale,
|
2020-02-01 23:27:14 +00:00
|
|
|
|
gtk_widget_get_direction (GTK_WIDGET (window)),
|
2020-01-28 15:14:52 +00:00
|
|
|
|
0);
|
2004-07-17 03:55:07 +00:00
|
|
|
|
else
|
2020-02-04 02:53:22 +00:00
|
|
|
|
info = gtk_icon_theme_lookup_icon (icon_theme, name, NULL,
|
2020-01-28 15:14:52 +00:00
|
|
|
|
sizes[i], priv->scale,
|
2020-02-01 23:27:14 +00:00
|
|
|
|
gtk_widget_get_direction (GTK_WIDGET (window)),
|
2020-01-28 15:14:52 +00:00
|
|
|
|
0);
|
2019-08-30 20:58:41 +00:00
|
|
|
|
|
2020-02-06 16:10:13 +00:00
|
|
|
|
texture = render_paintable_to_texture (GDK_PAINTABLE (info));
|
|
|
|
|
list = g_list_insert_sorted (list, texture, (GCompareFunc) icon_size_compare);
|
|
|
|
|
g_object_unref (info);
|
2004-07-17 03:55:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-10-04 14:47:03 +00:00
|
|
|
|
g_free (sizes);
|
|
|
|
|
|
2004-07-17 03:55:07 +00:00
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
2001-08-29 02:20:02 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_realize_icon (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2001-08-29 02:20:02 +00:00
|
|
|
|
GtkWindowIconInfo *info;
|
2018-12-30 06:02:59 +00:00
|
|
|
|
GList *icon_list = NULL;
|
2004-07-17 03:55:07 +00:00
|
|
|
|
|
2019-05-20 00:38:08 +00:00
|
|
|
|
g_return_if_fail (priv->surface != NULL);
|
2001-08-29 02:20:02 +00:00
|
|
|
|
|
|
|
|
|
info = ensure_icon_info (window);
|
|
|
|
|
|
|
|
|
|
if (info->realized)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
info->using_default_icon = FALSE;
|
2004-07-17 03:55:07 +00:00
|
|
|
|
info->using_themed_icon = FALSE;
|
|
|
|
|
|
|
|
|
|
/* Look up themed icon */
|
2018-12-30 06:02:59 +00:00
|
|
|
|
if (icon_list == NULL && info->icon_name)
|
2004-07-17 03:55:07 +00:00
|
|
|
|
{
|
2015-09-11 13:09:10 +00:00
|
|
|
|
icon_list = icon_list_from_theme (window, info->icon_name);
|
2004-10-04 15:16:57 +00:00
|
|
|
|
if (icon_list)
|
2018-12-30 06:02:59 +00:00
|
|
|
|
info->using_themed_icon = TRUE;
|
2001-08-29 02:20:02 +00:00
|
|
|
|
}
|
2004-07-17 03:55:07 +00:00
|
|
|
|
|
|
|
|
|
/* Look up themed icon */
|
2018-12-30 06:02:59 +00:00
|
|
|
|
if (icon_list == NULL && default_icon_name)
|
2004-07-17 03:55:07 +00:00
|
|
|
|
{
|
2015-09-11 13:09:10 +00:00
|
|
|
|
icon_list = icon_list_from_theme (window, default_icon_name);
|
2004-07-17 03:55:07 +00:00
|
|
|
|
info->using_default_icon = TRUE;
|
2013-03-10 04:03:38 +00:00
|
|
|
|
info->using_themed_icon = TRUE;
|
2004-07-17 03:55:07 +00:00
|
|
|
|
}
|
2001-08-29 02:20:02 +00:00
|
|
|
|
|
|
|
|
|
info->realized = TRUE;
|
2010-11-05 12:02:42 +00:00
|
|
|
|
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_set_icon_list (GDK_TOPLEVEL (priv->surface), icon_list);
|
2013-03-10 04:03:38 +00:00
|
|
|
|
|
2019-05-20 00:38:08 +00:00
|
|
|
|
if (info->using_themed_icon)
|
|
|
|
|
g_list_free_full (icon_list, g_object_unref);
|
2001-08-29 02:20:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-08-30 20:58:41 +00:00
|
|
|
|
GdkPaintable *
|
2018-12-30 06:22:44 +00:00
|
|
|
|
gtk_window_get_icon_for_size (GtkWindow *window,
|
|
|
|
|
int size)
|
2017-11-04 19:23:33 +00:00
|
|
|
|
{
|
2020-01-28 15:14:52 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2018-12-30 06:22:44 +00:00
|
|
|
|
const char *name;
|
2020-02-04 16:19:22 +00:00
|
|
|
|
GtkIconPaintable *info;
|
2017-11-29 22:23:56 +00:00
|
|
|
|
|
2018-12-30 06:22:44 +00:00
|
|
|
|
name = gtk_window_get_icon_name (window);
|
|
|
|
|
|
|
|
|
|
if (!name)
|
|
|
|
|
name = default_icon_name;
|
2019-02-27 06:29:57 +00:00
|
|
|
|
if (!name)
|
|
|
|
|
return NULL;
|
2018-12-30 06:22:44 +00:00
|
|
|
|
|
2020-02-01 22:38:49 +00:00
|
|
|
|
info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (window))),
|
2020-02-04 02:53:22 +00:00
|
|
|
|
name, NULL, size, priv->scale,
|
2020-02-01 23:27:14 +00:00
|
|
|
|
gtk_widget_get_direction (GTK_WIDGET (window)),
|
IconTheme: Simplify icon scaling
We had a pretty complex setup where we tried to avoid scaling up themes from dirs
that specified a size. However, not only was it very complex, but it didn't quite
work with window scales, because when using e.g. a size 32 directory for 16@2x
the dir size is wrong anyway. Additionally it turns out most code either picks
an existing icon size, or uses the FORCE_SIZE flags, so it doesn't seem
like a useful behaviour.
This change drops the FORCE_SIZE flags, and always scales
icons. Additionally it moves the scaling of the icon to rendering,
which seems more modern, and allows us to (later) share icons loaded
for different sizes that happened to use the same source file (at
different scales).
Note that this changes the behaviour of
gtk_icon_paintable_download_texture() is it now returns the unscaled
source icon. However, ignore thats, as I plan to remove this function
and replace it with a way to render a paintable to a cairo-surface
instead.
2020-02-05 14:47:23 +00:00
|
|
|
|
0);
|
2017-11-29 22:23:56 +00:00
|
|
|
|
if (info == NULL)
|
2017-11-04 19:23:33 +00:00
|
|
|
|
return NULL;
|
2014-01-24 20:40:37 +00:00
|
|
|
|
|
2020-01-27 14:40:58 +00:00
|
|
|
|
return GDK_PAINTABLE (info);
|
2014-01-24 20:40:37 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-08-29 02:20:02 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_unrealize_icon (GtkWindow *window)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowIconInfo *info;
|
|
|
|
|
|
|
|
|
|
info = get_icon_info (window);
|
|
|
|
|
|
|
|
|
|
if (info == NULL)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* We don't clear the properties on the window, just figure the
|
|
|
|
|
* window is going away.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
info->realized = FALSE;
|
2004-07-17 03:55:07 +00:00
|
|
|
|
|
2001-08-29 02:20:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-07-17 03:55:07 +00:00
|
|
|
|
static void
|
2015-12-02 02:28:36 +00:00
|
|
|
|
update_themed_icon (GtkWindow *window)
|
2004-07-17 03:55:07 +00:00
|
|
|
|
{
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ICON_NAME]);
|
2004-07-17 03:55:07 +00:00
|
|
|
|
|
|
|
|
|
gtk_window_unrealize_icon (window);
|
|
|
|
|
|
2015-09-06 23:58:03 +00:00
|
|
|
|
if (_gtk_widget_get_realized (GTK_WIDGET (window)))
|
2004-07-17 03:55:07 +00:00
|
|
|
|
gtk_window_realize_icon (window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_icon_name: (attributes org.gtk.Method.set_property=icon-name)
|
|
|
|
|
* @window: a `GtkWindow`
|
2009-12-10 10:23:40 +00:00
|
|
|
|
* @name: (allow-none): the name of the themed icon
|
2004-07-17 03:55:07 +00:00
|
|
|
|
*
|
2016-08-24 18:43:58 +00:00
|
|
|
|
* Sets the icon for the window from a named themed icon.
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*
|
|
|
|
|
* See the docs for [class@Gtk.IconTheme] for more details.
|
2016-08-24 18:43:58 +00:00
|
|
|
|
* On some platforms, the window icon is not used at all.
|
2009-12-10 10:23:40 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Note that this has nothing to do with the WM_ICON_NAME
|
2004-07-17 03:55:07 +00:00
|
|
|
|
* property which is mentioned in the ICCCM.
|
|
|
|
|
*/
|
2021-02-26 04:24:31 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_set_icon_name (GtkWindow *window,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *name)
|
2004-07-17 03:55:07 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWindowIconInfo *info;
|
2020-07-24 18:40:36 +00:00
|
|
|
|
char *tmp;
|
2018-12-30 06:02:59 +00:00
|
|
|
|
|
2004-07-17 03:55:07 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
|
|
info = ensure_icon_info (window);
|
|
|
|
|
|
2009-01-13 03:04:52 +00:00
|
|
|
|
if (g_strcmp0 (info->icon_name, name) == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
2004-07-17 03:55:07 +00:00
|
|
|
|
tmp = info->icon_name;
|
|
|
|
|
info->icon_name = g_strdup (name);
|
|
|
|
|
g_free (tmp);
|
|
|
|
|
|
2015-12-02 02:28:36 +00:00
|
|
|
|
update_themed_icon (window);
|
2004-07-17 03:55:07 +00:00
|
|
|
|
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ICON_NAME]);
|
2004-07-17 03:55:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_icon_name: (attributes org.gtk.Method.get_property=icon-name)
|
|
|
|
|
* @window: a `GtkWindow`
|
2004-07-17 03:55:07 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Returns the name of the themed icon for the window.
|
2004-07-17 03:55:07 +00:00
|
|
|
|
*
|
2015-11-08 16:17:00 +00:00
|
|
|
|
* Returns: (nullable): the icon name or %NULL if the window has
|
2004-07-17 03:55:07 +00:00
|
|
|
|
* no themed icon
|
|
|
|
|
*/
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *
|
2004-07-17 03:55:07 +00:00
|
|
|
|
gtk_window_get_icon_name (GtkWindow *window)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowIconInfo *info;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
|
|
|
|
|
|
|
|
|
|
info = ensure_icon_info (window);
|
|
|
|
|
|
|
|
|
|
return info->icon_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_window_set_default_icon_name:
|
|
|
|
|
* @name: the name of the themed icon
|
2009-02-20 05:54:53 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Sets an icon to be used as fallback.
|
|
|
|
|
*
|
|
|
|
|
* The fallback icon is used for windows that
|
|
|
|
|
* haven't had [method@Gtk.Window.set_icon_name]
|
|
|
|
|
* called on them.
|
|
|
|
|
*/
|
2004-07-17 03:55:07 +00:00
|
|
|
|
void
|
2020-07-24 18:40:36 +00:00
|
|
|
|
gtk_window_set_default_icon_name (const char *name)
|
2004-07-17 03:55:07 +00:00
|
|
|
|
{
|
|
|
|
|
GList *tmp_list;
|
|
|
|
|
GList *toplevels;
|
|
|
|
|
|
|
|
|
|
g_free (default_icon_name);
|
|
|
|
|
default_icon_name = g_strdup (name);
|
|
|
|
|
|
|
|
|
|
/* Update all toplevels */
|
|
|
|
|
toplevels = gtk_window_list_toplevels ();
|
|
|
|
|
tmp_list = toplevels;
|
|
|
|
|
while (tmp_list != NULL)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowIconInfo *info;
|
|
|
|
|
GtkWindow *w = tmp_list->data;
|
|
|
|
|
|
|
|
|
|
info = get_icon_info (w);
|
|
|
|
|
if (info && info->using_default_icon && info->using_themed_icon)
|
|
|
|
|
{
|
|
|
|
|
gtk_window_unrealize_icon (w);
|
2015-09-06 23:58:03 +00:00
|
|
|
|
if (_gtk_widget_get_realized (GTK_WIDGET (w)))
|
2004-07-17 03:55:07 +00:00
|
|
|
|
gtk_window_realize_icon (w);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tmp_list = tmp_list->next;
|
|
|
|
|
}
|
|
|
|
|
g_list_free (toplevels);
|
|
|
|
|
}
|
|
|
|
|
|
2009-02-20 05:54:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_get_default_icon_name:
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Returns the fallback icon name for windows.
|
2009-02-20 05:54:53 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* The returned string is owned by GTK and should not
|
|
|
|
|
* be modified. It is only valid until the next call to
|
|
|
|
|
* [func@Gtk.Window.set_default_icon_name].
|
2020-11-24 16:35:46 +00:00
|
|
|
|
*
|
|
|
|
|
* Returns: (nullable): the fallback icon name for windows
|
2009-02-20 05:54:53 +00:00
|
|
|
|
*/
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *
|
2009-02-20 05:54:53 +00:00
|
|
|
|
gtk_window_get_default_icon_name (void)
|
|
|
|
|
{
|
|
|
|
|
return default_icon_name;
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-12 15:56:20 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_update_csd_size (GtkWindow *window,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int *width,
|
|
|
|
|
int *height,
|
|
|
|
|
int apply)
|
2015-11-12 15:56:20 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2015-11-12 15:56:20 +00:00
|
|
|
|
GtkBorder window_border = { 0 };
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int w, h;
|
2015-11-12 15:56:20 +00:00
|
|
|
|
|
|
|
|
|
if (!priv->decorated ||
|
|
|
|
|
priv->fullscreen)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
get_shadow_width (window, &window_border);
|
|
|
|
|
w = *width + apply * (window_border.left + window_border.right);
|
|
|
|
|
h = *height + apply * (window_border.top + window_border.bottom);
|
|
|
|
|
|
|
|
|
|
/* Make sure the size remains acceptable */
|
|
|
|
|
if (w < 1)
|
|
|
|
|
w = 1;
|
|
|
|
|
if (h < 1)
|
|
|
|
|
h = 1;
|
|
|
|
|
|
|
|
|
|
/* Only update given size if not negative */
|
|
|
|
|
if (*width > -1)
|
|
|
|
|
*width = w;
|
|
|
|
|
if (*height > -1)
|
|
|
|
|
*height = h;
|
|
|
|
|
}
|
|
|
|
|
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_set_default_size_internal (GtkWindow *window,
|
|
|
|
|
gboolean change_width,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int width,
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
gboolean change_height,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int height)
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
{
|
2020-12-05 10:44:51 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (change_width == FALSE || width >= -1);
|
|
|
|
|
g_return_if_fail (change_height == FALSE || height >= -1);
|
|
|
|
|
|
|
|
|
|
g_object_freeze_notify (G_OBJECT (window));
|
|
|
|
|
|
|
|
|
|
if (change_width)
|
|
|
|
|
{
|
2020-12-05 10:44:51 +00:00
|
|
|
|
if (priv->default_width != width)
|
2014-06-07 20:40:57 +00:00
|
|
|
|
{
|
2020-12-05 10:44:51 +00:00
|
|
|
|
priv->default_width = width;
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_DEFAULT_WIDTH]);
|
2014-06-07 20:40:57 +00:00
|
|
|
|
}
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (change_height)
|
|
|
|
|
{
|
2020-12-05 10:44:51 +00:00
|
|
|
|
if (priv->default_height != height)
|
2014-06-07 20:40:57 +00:00
|
|
|
|
{
|
2020-12-05 10:44:51 +00:00
|
|
|
|
priv->default_height = height;
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_DEFAULT_HEIGHT]);
|
2014-06-07 20:40:57 +00:00
|
|
|
|
}
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_object_thaw_notify (G_OBJECT (window));
|
|
|
|
|
}
|
|
|
|
|
|
2001-02-03 01:09:41 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_set_default_size:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
* @width: width in pixels, or -1 to unset the default width
|
|
|
|
|
* @height: height in pixels, or -1 to unset the default height
|
2001-02-03 01:09:41 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Sets the default size of a window.
|
|
|
|
|
*
|
|
|
|
|
* If the window’s “natural” size (its size request) is larger than
|
|
|
|
|
* the default, the default will be ignored.
|
2016-02-15 13:23:12 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Unlike [method@Gtk.Widget.set_size_request], which sets a size
|
|
|
|
|
* request for a widget and thus would keep users from shrinking
|
|
|
|
|
* the window, this function only sets the initial size, just as
|
|
|
|
|
* if the user had resized the window themselves. Users can still
|
|
|
|
|
* shrink the window again as they normally would. Setting a default
|
|
|
|
|
* size of -1 means to use the “natural” default size (the size request
|
|
|
|
|
* of the window).
|
2001-02-03 01:09:41 +00:00
|
|
|
|
*
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
* The default size of a window only affects the first time a window is
|
|
|
|
|
* shown; if a window is hidden and re-shown, it will remember the size
|
|
|
|
|
* it had prior to hiding, rather than using the default size.
|
|
|
|
|
*
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* Windows can’t actually be 0x0 in size, they must be at least 1x1, but
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
* passing 0 for @width and @height is OK, resulting in a 1x1 default size.
|
2016-02-15 13:23:12 +00:00
|
|
|
|
*
|
|
|
|
|
* If you use this function to reestablish a previously saved window size,
|
|
|
|
|
* note that the appropriate size to save is the one returned by
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* [method@Gtk.Window.get_default_size]. Using the window allocation
|
|
|
|
|
* directly will not work in all circumstances and can lead to growing
|
|
|
|
|
* or shrinking windows.
|
2016-02-15 13:23:12 +00:00
|
|
|
|
*/
|
2019-05-20 00:38:08 +00:00
|
|
|
|
void
|
1998-12-07 06:37:27 +00:00
|
|
|
|
gtk_window_set_default_size (GtkWindow *window,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int width,
|
|
|
|
|
int height)
|
1998-12-07 06:37:27 +00:00
|
|
|
|
{
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
g_return_if_fail (width >= -1);
|
|
|
|
|
g_return_if_fail (height >= -1);
|
1998-12-07 06:37:27 +00:00
|
|
|
|
|
2016-09-05 01:09:39 +00:00
|
|
|
|
gtk_window_set_default_size_internal (window, TRUE, width, TRUE, height);
|
2020-12-05 10:44:51 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (window));
|
2010-10-10 02:38:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_get_default_size:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2010-05-12 22:51:55 +00:00
|
|
|
|
* @width: (out) (allow-none): location to store the default width, or %NULL
|
|
|
|
|
* @height: (out) (allow-none): location to store the default height, or %NULL
|
2001-06-24 15:34:48 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Gets the default size of the window.
|
|
|
|
|
*
|
|
|
|
|
* A value of 0 for the width or height indicates that a default
|
|
|
|
|
* size has not been explicitly set for that dimension, so the
|
|
|
|
|
* “natural” size of the window will be used.
|
|
|
|
|
*/
|
2001-06-24 15:34:48 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_get_default_size (GtkWindow *window,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int *width,
|
|
|
|
|
int *height)
|
2001-06-24 15:34:48 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2020-12-05 10:44:51 +00:00
|
|
|
|
gtk_window_get_remembered_size (window, width, height);
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-12-31 15:42:10 +00:00
|
|
|
|
static gboolean
|
2018-01-01 20:24:16 +00:00
|
|
|
|
gtk_window_close_request (GtkWindow *window)
|
2017-12-31 15:42:10 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2017-12-31 15:42:10 +00:00
|
|
|
|
|
|
|
|
|
if (priv->hide_on_close)
|
|
|
|
|
{
|
2018-01-01 20:24:16 +00:00
|
|
|
|
gtk_widget_hide (GTK_WIDGET (window));
|
|
|
|
|
return TRUE;
|
2017-12-31 15:42:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-01-01 20:24:16 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-07 14:47:44 +00:00
|
|
|
|
gboolean
|
2018-01-01 20:24:16 +00:00
|
|
|
|
gtk_window_emit_close_request (GtkWindow *window)
|
|
|
|
|
{
|
2018-01-18 14:10:49 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2018-01-01 20:24:16 +00:00
|
|
|
|
gboolean handled;
|
|
|
|
|
|
2018-01-18 14:10:49 +00:00
|
|
|
|
/* Avoid re-entrancy issues when calling gtk_window_close from a
|
|
|
|
|
* close-request handler */
|
|
|
|
|
if (priv->in_emit_close_request)
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
|
|
priv->in_emit_close_request = TRUE;
|
2018-01-01 20:24:16 +00:00
|
|
|
|
g_signal_emit (window, window_signals[CLOSE_REQUEST], 0, &handled);
|
2018-01-18 14:10:49 +00:00
|
|
|
|
priv->in_emit_close_request = FALSE;
|
2018-01-01 20:24:16 +00:00
|
|
|
|
|
|
|
|
|
return handled;
|
2017-12-31 15:42:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
gtk_window_finalize (GObject *object)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (object);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-05-15 01:27:45 +00:00
|
|
|
|
GdkSeat *seat;
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
g_free (priv->title);
|
2010-08-11 05:23:23 +00:00
|
|
|
|
gtk_window_release_application (window);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (priv->geometry_info)
|
2001-04-01 04:05:42 +00:00
|
|
|
|
{
|
2010-08-17 13:37:57 +00:00
|
|
|
|
g_free (priv->geometry_info);
|
2001-04-01 04:05:42 +00:00
|
|
|
|
}
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (priv->keys_changed_handler)
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
{
|
2010-08-17 13:37:57 +00:00
|
|
|
|
g_source_remove (priv->keys_changed_handler);
|
|
|
|
|
priv->keys_changed_handler = 0;
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-05-15 01:27:45 +00:00
|
|
|
|
seat = gdk_display_get_default_seat (priv->display);
|
|
|
|
|
if (seat)
|
|
|
|
|
g_signal_handlers_disconnect_by_func (seat, device_removed_cb, window);
|
2018-01-19 17:47:21 +00:00
|
|
|
|
|
2016-10-29 01:25:06 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
2017-10-31 06:41:15 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (gtk_settings_get_for_display (priv->display),
|
|
|
|
|
gtk_window_on_theme_variant_changed,
|
|
|
|
|
window);
|
2016-10-29 01:25:06 +00:00
|
|
|
|
#endif
|
2009-08-30 01:15:10 +00:00
|
|
|
|
|
|
|
|
|
g_free (priv->startup_id);
|
|
|
|
|
|
2013-04-02 19:56:31 +00:00
|
|
|
|
if (priv->mnemonics_display_timeout_id)
|
2012-08-20 23:28:25 +00:00
|
|
|
|
{
|
2013-04-02 19:56:31 +00:00
|
|
|
|
g_source_remove (priv->mnemonics_display_timeout_id);
|
|
|
|
|
priv->mnemonics_display_timeout_id = 0;
|
2012-08-20 23:28:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-21 22:14:40 +00:00
|
|
|
|
if (priv->focus_visible_timeout)
|
|
|
|
|
{
|
|
|
|
|
g_source_remove (priv->focus_visible_timeout);
|
|
|
|
|
priv->focus_visible_timeout = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-09 13:22:19 +00:00
|
|
|
|
g_clear_object (&priv->constraint_solver);
|
2016-10-21 08:12:40 +00:00
|
|
|
|
g_clear_object (&priv->renderer);
|
2020-04-10 18:35:02 +00:00
|
|
|
|
g_clear_object (&priv->resize_cursor);
|
2016-10-21 08:12:40 +00:00
|
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_window_parent_class)->finalize (object);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-02-04 11:14:46 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
update_csd_visibility (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2014-02-04 11:14:46 +00:00
|
|
|
|
gboolean visible;
|
|
|
|
|
|
|
|
|
|
if (priv->title_box == NULL)
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
2017-05-09 06:32:06 +00:00
|
|
|
|
visible = !priv->fullscreen &&
|
|
|
|
|
priv->decorated;
|
2017-05-01 16:57:05 +00:00
|
|
|
|
|
2014-02-04 11:14:46 +00:00
|
|
|
|
gtk_widget_set_child_visible (priv->title_box, visible);
|
2014-02-04 12:52:11 +00:00
|
|
|
|
|
2014-02-04 11:14:46 +00:00
|
|
|
|
return visible;
|
|
|
|
|
}
|
|
|
|
|
|
2013-12-11 06:26:34 +00:00
|
|
|
|
static void
|
2020-04-22 17:32:10 +00:00
|
|
|
|
update_window_actions (GtkWindow *window)
|
2013-12-11 06:26:34 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-04-22 17:32:10 +00:00
|
|
|
|
gboolean is_sovereign_window = !priv->modal && !priv->transient_parent;
|
2013-05-13 00:47:55 +00:00
|
|
|
|
|
2020-04-22 17:32:10 +00:00
|
|
|
|
gtk_widget_action_set_enabled (GTK_WIDGET (window), "window.minimize",
|
|
|
|
|
is_sovereign_window);
|
|
|
|
|
gtk_widget_action_set_enabled (GTK_WIDGET (window), "window.toggle-maximized",
|
|
|
|
|
priv->resizable && is_sovereign_window);
|
|
|
|
|
gtk_widget_action_set_enabled (GTK_WIDGET (window), "window.close",
|
|
|
|
|
priv->deletable);
|
2014-02-04 11:14:46 +00:00
|
|
|
|
|
2020-04-22 17:39:40 +00:00
|
|
|
|
update_csd_visibility (window);
|
2013-08-21 18:59:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-06-06 21:59:38 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_window_request_csd (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2014-06-06 21:59:38 +00:00
|
|
|
|
|
|
|
|
|
priv->csd_requested = TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-21 19:05:44 +00:00
|
|
|
|
static gboolean
|
2014-06-04 10:38:20 +00:00
|
|
|
|
gtk_window_should_use_csd (GtkWindow *window)
|
2012-04-11 16:55:54 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *csd_env;
|
2012-04-11 16:55:54 +00:00
|
|
|
|
|
2015-11-10 11:00:48 +00:00
|
|
|
|
if (priv->csd_requested)
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
2013-03-18 12:28:44 +00:00
|
|
|
|
if (!priv->decorated)
|
2013-08-21 19:05:44 +00:00
|
|
|
|
return FALSE;
|
2013-03-18 12:28:44 +00:00
|
|
|
|
|
2015-12-27 03:37:21 +00:00
|
|
|
|
csd_env = g_getenv ("GTK_CSD");
|
|
|
|
|
|
2015-06-22 13:19:29 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_BROADWAY
|
|
|
|
|
if (GDK_IS_BROADWAY_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
|
|
|
|
|
return TRUE;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef GDK_WINDOWING_WAYLAND
|
|
|
|
|
if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
|
2017-04-29 00:35:51 +00:00
|
|
|
|
{
|
|
|
|
|
GdkDisplay *gdk_display = gtk_widget_get_display (GTK_WIDGET (window));
|
|
|
|
|
return !gdk_wayland_display_prefers_ssd (gdk_display);
|
|
|
|
|
}
|
2015-06-22 13:19:29 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2015-12-27 03:37:21 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_WIN32
|
|
|
|
|
if (g_strcmp0 (csd_env, "0") != 0 &&
|
|
|
|
|
GDK_IS_WIN32_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
|
|
|
|
|
return TRUE;
|
|
|
|
|
#endif
|
2015-06-22 13:19:29 +00:00
|
|
|
|
|
|
|
|
|
return (g_strcmp0 (csd_env, "1") == 0);
|
2013-08-21 19:05:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_show (GtkWidget *widget)
|
|
|
|
|
{
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2002-01-30 18:58:31 +00:00
|
|
|
|
|
2019-05-29 14:51:42 +00:00
|
|
|
|
_gtk_widget_set_visible_flag (widget, TRUE);
|
|
|
|
|
|
2015-02-20 16:28:23 +00:00
|
|
|
|
gtk_css_node_validate (gtk_widget_get_css_node (widget));
|
2012-05-01 23:43:52 +00:00
|
|
|
|
|
2015-12-01 16:25:54 +00:00
|
|
|
|
gtk_widget_realize (widget);
|
2001-01-08 17:04:17 +00:00
|
|
|
|
|
2020-12-04 08:23:46 +00:00
|
|
|
|
gtk_window_present_toplevel (window);
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
gtk_widget_map (widget);
|
1998-08-11 19:06:18 +00:00
|
|
|
|
|
2016-10-03 16:30:40 +00:00
|
|
|
|
if (!priv->focus_widget)
|
2020-03-30 03:38:34 +00:00
|
|
|
|
gtk_window_move_focus (widget, GTK_DIR_TAB_FORWARD);
|
2002-01-30 18:58:31 +00:00
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (priv->modal)
|
1999-02-20 19:00:53 +00:00
|
|
|
|
gtk_grab_add (widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_window_hide (GtkWidget *widget)
|
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
1999-02-20 19:00:53 +00:00
|
|
|
|
|
2019-05-29 14:51:42 +00:00
|
|
|
|
_gtk_widget_set_visible_flag (widget, FALSE);
|
|
|
|
|
gtk_widget_unmap (widget);
|
1998-08-11 19:06:18 +00:00
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (priv->modal)
|
1999-02-20 19:00:53 +00:00
|
|
|
|
gtk_grab_remove (widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-29 11:53:24 +00:00
|
|
|
|
static GdkToplevelLayout *
|
2020-12-16 10:53:19 +00:00
|
|
|
|
gtk_window_compute_base_layout (GtkWindow *window)
|
2020-02-29 11:53:24 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
GdkToplevelLayout *layout;
|
|
|
|
|
|
2020-07-30 21:06:59 +00:00
|
|
|
|
layout = gdk_toplevel_layout_new ();
|
2020-02-29 11:53:24 +00:00
|
|
|
|
|
|
|
|
|
gdk_toplevel_layout_set_resizable (layout, priv->resizable);
|
|
|
|
|
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_window_present_toplevel (GtkWindow *window)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-12-16 10:53:19 +00:00
|
|
|
|
GdkToplevelLayout *layout;
|
2020-02-29 11:53:24 +00:00
|
|
|
|
|
2020-12-16 10:53:19 +00:00
|
|
|
|
layout = gtk_window_compute_base_layout (window);
|
|
|
|
|
gdk_toplevel_layout_set_maximized (layout, priv->maximized);
|
|
|
|
|
gdk_toplevel_layout_set_fullscreen (layout, priv->fullscreen,
|
|
|
|
|
priv->initial_fullscreen_monitor);
|
|
|
|
|
gdk_toplevel_present (GDK_TOPLEVEL (priv->surface), layout);
|
|
|
|
|
gdk_toplevel_layout_unref (layout);
|
2020-02-29 11:53:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2020-12-16 10:53:19 +00:00
|
|
|
|
gtk_window_update_toplevel (GtkWindow *window,
|
|
|
|
|
GdkToplevelLayout *layout)
|
2020-02-29 11:53:24 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2020-12-16 09:10:00 +00:00
|
|
|
|
if (_gtk_widget_get_mapped (GTK_WIDGET (window)))
|
2020-12-16 10:53:19 +00:00
|
|
|
|
gdk_toplevel_present (GDK_TOPLEVEL (priv->surface), layout);
|
|
|
|
|
gdk_toplevel_layout_unref (layout);
|
2020-02-29 11:53:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_map (GtkWidget *widget)
|
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-05-02 19:17:20 +00:00
|
|
|
|
GtkWidget *child = priv->child;
|
2002-09-25 19:16:46 +00:00
|
|
|
|
|
2016-11-04 09:04:44 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_window_parent_class)->map (widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2012-04-11 16:55:54 +00:00
|
|
|
|
if (child != NULL && gtk_widget_get_visible (child))
|
2010-05-24 20:31:36 +00:00
|
|
|
|
gtk_widget_map (child);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2013-10-06 03:17:02 +00:00
|
|
|
|
if (priv->title_box != NULL &&
|
|
|
|
|
gtk_widget_get_visible (priv->title_box) &&
|
|
|
|
|
gtk_widget_get_child_visible (priv->title_box))
|
2012-04-11 16:55:54 +00:00
|
|
|
|
gtk_widget_map (priv->title_box);
|
|
|
|
|
|
2020-03-18 00:46:57 +00:00
|
|
|
|
gtk_window_present_toplevel (window);
|
2011-10-01 00:18:52 +00:00
|
|
|
|
|
2019-11-16 19:50:57 +00:00
|
|
|
|
if (priv->minimize_initially)
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_minimize (GDK_TOPLEVEL (priv->surface));
|
2003-08-10 23:37:37 +00:00
|
|
|
|
|
2020-02-14 20:13:42 +00:00
|
|
|
|
gtk_window_set_theme_variant (window);
|
2011-03-20 13:37:27 +00:00
|
|
|
|
|
2020-02-14 20:13:42 +00:00
|
|
|
|
if (!disable_startup_notification)
|
2002-11-02 05:37:04 +00:00
|
|
|
|
{
|
2007-03-13 17:03:54 +00:00
|
|
|
|
/* Do we have a custom startup-notification id? */
|
|
|
|
|
if (priv->startup_id != NULL)
|
|
|
|
|
{
|
|
|
|
|
/* Make sure we have a "real" id */
|
2011-08-10 14:00:38 +00:00
|
|
|
|
if (!startup_id_is_fake (priv->startup_id))
|
2017-11-17 03:45:04 +00:00
|
|
|
|
gdk_display_notify_startup_complete (gtk_widget_get_display (widget), priv->startup_id);
|
2009-08-30 01:15:10 +00:00
|
|
|
|
|
|
|
|
|
g_free (priv->startup_id);
|
2007-03-13 17:03:54 +00:00
|
|
|
|
priv->startup_id = NULL;
|
|
|
|
|
}
|
2017-11-17 03:45:04 +00:00
|
|
|
|
else
|
|
|
|
|
gdk_display_notify_startup_complete (gtk_widget_get_display (widget), NULL);
|
2002-11-02 05:37:04 +00:00
|
|
|
|
}
|
2009-12-20 08:04:52 +00:00
|
|
|
|
|
2011-08-10 14:00:38 +00:00
|
|
|
|
/* inherit from transient parent, so that a dialog that is
|
|
|
|
|
* opened via keynav shows focus initially
|
|
|
|
|
*/
|
|
|
|
|
if (priv->transient_parent)
|
|
|
|
|
gtk_window_set_focus_visible (window, gtk_window_get_focus_visible (priv->transient_parent));
|
|
|
|
|
else
|
2013-07-08 16:53:23 +00:00
|
|
|
|
gtk_window_set_focus_visible (window, FALSE);
|
Refactor GtkApplication
gtkapplication.c has turned into a bit of an #ifdef mess over time, and
many of the current checks are incorrect. As an example, if you build
Gtk for wayland, and exclude the X11 backend, much of the functionality
required by wayland (such as exporting menu models) will be disabled.
Solve that by introducing a backend mechanism to GtkApplication (named
GtkApplicationImpl) similar to the one in GApplication. Add backends
for Wayland, X11 and Quartz, with X11 and Wayland sharing a common
'DBus' superclass.
GtkApplicationImpl
|
/--------------+-------------------\
| |
GtkApplicationImplDBus GtkApplicationImplQuartz
|
/-----------+-----------------\
| |
GtkApplicationImplX11 GtkApplicationImplWayland
GtkApplicationImpl itself is essentially a bunch of vfuncs that serve as
hooks for various things that the platform-specific backends may be
interested in doing (startup, shutdown, managing windows, inhibit, etc.)
With this change, all platform specific code has been removed from
gtkapplication.c and gtkapplicationwindow.c (both of which are now free
of #ifdefs, except for a UNIX-specific use of GDesktopAppInfo in
gtkapplicationwindow.c).
Additionally, because of the movement of the property-setting code out
of GtkApplicationWindow, the _GTK_APPLICATION_ID properties (and
friends) will be set on non-GtkApplicationWindows, such as dialogs.
https://bugzilla.gnome.org/show_bug.cgi?id=720550
2013-12-16 14:32:13 +00:00
|
|
|
|
|
|
|
|
|
if (priv->application)
|
|
|
|
|
gtk_application_handle_window_map (priv->application, window);
|
2021-01-21 16:39:22 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_realize_at_context (widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_window_unmap (GtkWidget *widget)
|
|
|
|
|
{
|
2002-01-30 22:29:03 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-05-02 19:17:20 +00:00
|
|
|
|
GtkWidget *child = priv->child;
|
2002-01-28 18:52:49 +00:00
|
|
|
|
|
2016-11-04 09:04:44 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_window_parent_class)->unmap (widget);
|
2019-05-20 00:38:08 +00:00
|
|
|
|
gdk_surface_hide (priv->surface);
|
2010-08-15 14:49:55 +00:00
|
|
|
|
|
2021-01-21 16:39:22 +00:00
|
|
|
|
gtk_widget_unrealize_at_context (widget);
|
|
|
|
|
|
2012-04-11 16:55:54 +00:00
|
|
|
|
if (priv->title_box != NULL)
|
|
|
|
|
gtk_widget_unmap (priv->title_box);
|
|
|
|
|
|
|
|
|
|
if (child != NULL)
|
2010-12-20 17:58:04 +00:00
|
|
|
|
gtk_widget_unmap (child);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-04-09 10:06:51 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_get_remembered_size (GtkWindow *window,
|
|
|
|
|
int *width,
|
|
|
|
|
int *height)
|
|
|
|
|
{
|
2020-12-05 10:44:51 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2013-04-08 14:25:29 +00:00
|
|
|
|
|
2020-12-05 10:44:51 +00:00
|
|
|
|
*width = priv->default_width;
|
|
|
|
|
*height = priv->default_height;
|
2011-04-26 16:42:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-06-26 23:45:55 +00:00
|
|
|
|
static void
|
|
|
|
|
check_scale_changed (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2014-06-26 23:45:55 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (window);
|
|
|
|
|
int old_scale;
|
|
|
|
|
|
|
|
|
|
old_scale = priv->scale;
|
|
|
|
|
priv->scale = gtk_widget_get_scale_factor (widget);
|
|
|
|
|
if (old_scale != priv->scale)
|
|
|
|
|
_gtk_widget_scale_changed (widget);
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-17 22:16:45 +00:00
|
|
|
|
static void
|
2015-09-11 13:09:10 +00:00
|
|
|
|
get_shadow_width (GtkWindow *window,
|
2014-09-17 22:16:45 +00:00
|
|
|
|
GtkBorder *shadow_width)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-05-20 07:32:44 +00:00
|
|
|
|
GtkCssStyle *style;
|
2005-08-30 04:46:09 +00:00
|
|
|
|
|
2015-05-18 03:19:14 +00:00
|
|
|
|
if (!priv->decorated)
|
2020-05-20 07:32:44 +00:00
|
|
|
|
goto out;
|
2015-05-18 03:19:14 +00:00
|
|
|
|
|
2015-11-09 11:05:37 +00:00
|
|
|
|
if (!priv->client_decorated &&
|
|
|
|
|
!(gtk_window_should_use_csd (window) &&
|
2015-05-18 03:19:14 +00:00
|
|
|
|
gtk_window_supports_client_shadow (window)))
|
2020-05-20 07:32:44 +00:00
|
|
|
|
goto out;
|
2012-04-11 16:55:54 +00:00
|
|
|
|
|
2014-09-17 22:16:45 +00:00
|
|
|
|
if (priv->maximized ||
|
2015-08-12 23:35:10 +00:00
|
|
|
|
priv->fullscreen)
|
2020-05-20 07:32:44 +00:00
|
|
|
|
goto out;
|
2010-12-23 17:10:07 +00:00
|
|
|
|
|
2020-05-20 07:32:44 +00:00
|
|
|
|
style = gtk_css_node_get_style (gtk_widget_get_css_node (GTK_WIDGET (window)));
|
2010-12-23 12:51:25 +00:00
|
|
|
|
|
2015-11-14 17:28:34 +00:00
|
|
|
|
/* Calculate the size of the drop shadows ... */
|
2020-05-20 07:32:44 +00:00
|
|
|
|
gtk_css_shadow_value_get_extents (style->background->box_shadow, shadow_width);
|
|
|
|
|
return;
|
2010-10-08 18:21:11 +00:00
|
|
|
|
|
2020-05-20 07:32:44 +00:00
|
|
|
|
out:
|
|
|
|
|
*shadow_width = (GtkBorder) {0, 0, 0, 0};
|
2020-02-22 15:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-04-11 16:55:54 +00:00
|
|
|
|
static void
|
2014-09-17 22:16:45 +00:00
|
|
|
|
corner_rect (cairo_rectangle_int_t *rect,
|
|
|
|
|
const GtkCssValue *value)
|
2012-04-11 16:55:54 +00:00
|
|
|
|
{
|
2014-09-17 22:16:45 +00:00
|
|
|
|
rect->width = _gtk_css_corner_value_get_x (value, 100);
|
|
|
|
|
rect->height = _gtk_css_corner_value_get_y (value, 100);
|
2013-04-22 21:28:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-09-27 03:19:29 +00:00
|
|
|
|
static void
|
2019-11-30 18:19:26 +00:00
|
|
|
|
subtract_decoration_corners_from_region (cairo_region_t *region,
|
|
|
|
|
cairo_rectangle_int_t *extents,
|
2020-05-20 07:28:27 +00:00
|
|
|
|
GtkCssStyle *style,
|
2019-11-30 18:19:26 +00:00
|
|
|
|
GtkWindow *window)
|
2013-09-27 03:19:29 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2014-09-17 22:16:45 +00:00
|
|
|
|
cairo_rectangle_int_t rect;
|
2013-09-27 03:19:29 +00:00
|
|
|
|
|
2019-11-30 18:19:26 +00:00
|
|
|
|
if (!priv->client_decorated ||
|
|
|
|
|
!priv->decorated ||
|
|
|
|
|
priv->fullscreen ||
|
|
|
|
|
priv->maximized)
|
|
|
|
|
return;
|
|
|
|
|
|
2020-05-20 07:28:27 +00:00
|
|
|
|
corner_rect (&rect, style->border->border_top_left_radius);
|
2014-09-17 22:16:45 +00:00
|
|
|
|
rect.x = extents->x;
|
|
|
|
|
rect.y = extents->y;
|
|
|
|
|
cairo_region_subtract_rectangle (region, &rect);
|
|
|
|
|
|
2020-05-20 07:28:27 +00:00
|
|
|
|
corner_rect (&rect, style->border->border_top_right_radius);
|
2014-09-17 22:16:45 +00:00
|
|
|
|
rect.x = extents->x + extents->width - rect.width;
|
|
|
|
|
rect.y = extents->y;
|
|
|
|
|
cairo_region_subtract_rectangle (region, &rect);
|
|
|
|
|
|
2020-05-20 07:28:27 +00:00
|
|
|
|
corner_rect (&rect, style->border->border_bottom_left_radius);
|
2014-09-17 22:16:45 +00:00
|
|
|
|
rect.x = extents->x;
|
|
|
|
|
rect.y = extents->y + extents->height - rect.height;
|
|
|
|
|
cairo_region_subtract_rectangle (region, &rect);
|
|
|
|
|
|
2020-05-20 07:28:27 +00:00
|
|
|
|
corner_rect (&rect, style->border->border_bottom_right_radius);
|
2014-09-17 22:16:45 +00:00
|
|
|
|
rect.x = extents->x + extents->width - rect.width;
|
|
|
|
|
rect.y = extents->y + extents->height - rect.height;
|
|
|
|
|
cairo_region_subtract_rectangle (region, &rect);
|
2014-03-12 04:15:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-08-27 19:35:46 +00:00
|
|
|
|
static void
|
2020-05-20 07:30:01 +00:00
|
|
|
|
update_opaque_region (GtkWindow *window,
|
|
|
|
|
const GtkBorder *shadow)
|
2013-08-27 19:35:46 +00:00
|
|
|
|
{
|
2019-05-20 00:38:08 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2014-09-17 22:16:45 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (window);
|
|
|
|
|
cairo_region_t *opaque_region;
|
|
|
|
|
gboolean is_opaque = FALSE;
|
2020-05-20 07:30:01 +00:00
|
|
|
|
GtkCssStyle *style;
|
2014-09-17 22:16:45 +00:00
|
|
|
|
|
2015-09-06 23:58:03 +00:00
|
|
|
|
if (!_gtk_widget_get_realized (widget))
|
2020-05-20 07:30:01 +00:00
|
|
|
|
return;
|
2014-09-17 22:16:45 +00:00
|
|
|
|
|
2020-05-20 07:30:01 +00:00
|
|
|
|
style = gtk_css_node_get_style (gtk_widget_get_css_node (GTK_WIDGET (window)));
|
2014-09-17 22:16:45 +00:00
|
|
|
|
|
2020-05-20 07:30:01 +00:00
|
|
|
|
is_opaque = gdk_rgba_is_opaque (gtk_css_color_value_get_rgba (style->background->background_color));
|
2014-09-17 22:16:45 +00:00
|
|
|
|
|
2020-05-20 07:30:01 +00:00
|
|
|
|
if (is_opaque && gtk_widget_get_opacity (widget) < 1.0)
|
2014-10-28 14:28:23 +00:00
|
|
|
|
is_opaque = FALSE;
|
|
|
|
|
|
2014-09-17 22:16:45 +00:00
|
|
|
|
if (is_opaque)
|
|
|
|
|
{
|
|
|
|
|
cairo_rectangle_int_t rect;
|
2020-05-20 07:30:01 +00:00
|
|
|
|
GtkCssBoxes css_boxes;
|
|
|
|
|
const graphene_rect_t *border_rect;
|
|
|
|
|
double native_x, native_y;
|
2014-09-17 22:16:45 +00:00
|
|
|
|
|
2020-05-20 07:30:01 +00:00
|
|
|
|
gtk_native_get_surface_transform (GTK_NATIVE (window), &native_x, &native_y);
|
|
|
|
|
|
|
|
|
|
gtk_css_boxes_init (&css_boxes, widget);
|
|
|
|
|
border_rect = gtk_css_boxes_get_border_rect (&css_boxes);
|
|
|
|
|
|
|
|
|
|
rect.x = native_x + border_rect->origin.x;
|
|
|
|
|
rect.y = native_y + border_rect->origin.y;
|
|
|
|
|
rect.width = border_rect->size.width;
|
|
|
|
|
rect.height = border_rect->size.height;
|
2014-09-17 22:16:45 +00:00
|
|
|
|
|
|
|
|
|
opaque_region = cairo_region_create_rectangle (&rect);
|
|
|
|
|
|
2020-05-20 07:30:01 +00:00
|
|
|
|
subtract_decoration_corners_from_region (opaque_region, &rect, style, window);
|
2014-09-17 22:16:45 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
opaque_region = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-20 00:38:08 +00:00
|
|
|
|
gdk_surface_set_opaque_region (priv->surface, opaque_region);
|
2014-09-17 22:16:45 +00:00
|
|
|
|
|
|
|
|
|
cairo_region_destroy (opaque_region);
|
2013-08-27 19:35:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-10-06 04:35:05 +00:00
|
|
|
|
static void
|
2020-05-20 07:32:44 +00:00
|
|
|
|
update_realized_window_properties (GtkWindow *window)
|
2013-10-06 04:35:05 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-05-20 07:32:44 +00:00
|
|
|
|
GtkBorder shadow;
|
|
|
|
|
GtkBorder resize_handle;
|
|
|
|
|
GdkRectangle rect;
|
|
|
|
|
GtkCssBoxes css_boxes;
|
|
|
|
|
const graphene_rect_t *border_rect;
|
|
|
|
|
double native_x, native_y;
|
|
|
|
|
|
|
|
|
|
get_shadow_width (window, &shadow);
|
|
|
|
|
update_opaque_region (window, &shadow);
|
|
|
|
|
|
|
|
|
|
if (!priv->client_decorated)
|
|
|
|
|
return;
|
2013-10-06 04:35:05 +00:00
|
|
|
|
|
2020-05-20 07:32:44 +00:00
|
|
|
|
gtk_native_get_surface_transform (GTK_NATIVE (window), &native_x, &native_y);
|
|
|
|
|
|
|
|
|
|
/* update the input shape, which makes it so that clicks
|
|
|
|
|
* outside the border windows go through. */
|
|
|
|
|
gtk_css_boxes_init (&css_boxes, GTK_WIDGET (window));
|
|
|
|
|
border_rect = gtk_css_boxes_get_border_rect (&css_boxes);
|
|
|
|
|
|
|
|
|
|
/* This logic is duplicated in get_edge_for_coordinates() */
|
|
|
|
|
resize_handle.left = MIN (shadow.left, RESIZE_HANDLE_SIZE);
|
|
|
|
|
resize_handle.top = MIN (shadow.top, RESIZE_HANDLE_SIZE);
|
|
|
|
|
resize_handle.right = MIN (shadow.right, RESIZE_HANDLE_SIZE);
|
|
|
|
|
resize_handle.bottom = MIN (shadow.bottom, RESIZE_HANDLE_SIZE);
|
|
|
|
|
|
|
|
|
|
rect.x = native_x + border_rect->origin.x - resize_handle.left;
|
|
|
|
|
rect.y = native_y + border_rect->origin.y - resize_handle.top;
|
|
|
|
|
rect.width = border_rect->size.width + resize_handle.left + resize_handle.right;
|
|
|
|
|
rect.height = border_rect->size.height + resize_handle.top + resize_handle.bottom;
|
|
|
|
|
|
|
|
|
|
if (rect.width > 0 && rect.height > 0)
|
|
|
|
|
{
|
|
|
|
|
cairo_region_t *region = cairo_region_create_rectangle (&rect);
|
|
|
|
|
|
|
|
|
|
gdk_surface_set_input_region (priv->surface, region);
|
|
|
|
|
cairo_region_destroy (region);
|
|
|
|
|
}
|
2013-10-06 04:35:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-07-30 21:06:59 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_compute_default_size (GtkWindow *window,
|
|
|
|
|
int max_width,
|
|
|
|
|
int max_height,
|
2020-10-06 15:05:40 +00:00
|
|
|
|
int *min_width,
|
|
|
|
|
int *min_height,
|
|
|
|
|
int *nat_width,
|
|
|
|
|
int *nat_height)
|
2020-07-30 21:06:59 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (window);
|
|
|
|
|
|
|
|
|
|
if (gtk_widget_get_request_mode (widget) == GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT)
|
|
|
|
|
{
|
|
|
|
|
int minimum, natural;
|
|
|
|
|
|
|
|
|
|
gtk_widget_measure (widget, GTK_ORIENTATION_VERTICAL, -1,
|
|
|
|
|
&minimum, &natural,
|
|
|
|
|
NULL, NULL);
|
2020-10-06 15:05:40 +00:00
|
|
|
|
*min_height = minimum;
|
|
|
|
|
*nat_height = MAX (minimum, MIN (max_height, natural));
|
2020-07-30 21:06:59 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL,
|
2020-10-06 15:05:40 +00:00
|
|
|
|
*nat_height,
|
2020-07-30 21:06:59 +00:00
|
|
|
|
&minimum, &natural,
|
|
|
|
|
NULL, NULL);
|
2020-10-06 15:05:40 +00:00
|
|
|
|
*min_width = minimum;
|
|
|
|
|
*nat_width = MAX (minimum, MIN (max_width, natural));
|
2020-07-30 21:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
else /* GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH or CONSTANT_SIZE */
|
|
|
|
|
{
|
|
|
|
|
int minimum, natural;
|
|
|
|
|
|
|
|
|
|
gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL, -1,
|
|
|
|
|
&minimum, &natural,
|
|
|
|
|
NULL, NULL);
|
2020-10-06 15:05:40 +00:00
|
|
|
|
*min_width = minimum;
|
|
|
|
|
*nat_width = MAX (minimum, MIN (max_width, natural));
|
2020-07-30 21:06:59 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_measure (widget, GTK_ORIENTATION_VERTICAL,
|
2020-10-06 15:05:40 +00:00
|
|
|
|
*nat_width,
|
2020-07-30 21:06:59 +00:00
|
|
|
|
&minimum, &natural,
|
|
|
|
|
NULL, NULL);
|
2020-10-06 15:05:40 +00:00
|
|
|
|
*min_height = minimum;
|
|
|
|
|
*nat_height = MAX (minimum, MIN (max_height, natural));
|
2020-07-30 21:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-05 10:44:51 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
should_remember_size (GtkWindow *window)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
if (!priv->resizable)
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
return !(priv->state & (GDK_TOPLEVEL_STATE_FULLSCREEN |
|
|
|
|
|
GDK_TOPLEVEL_STATE_MAXIMIZED |
|
|
|
|
|
GDK_TOPLEVEL_STATE_TILED |
|
|
|
|
|
GDK_TOPLEVEL_STATE_TOP_TILED |
|
|
|
|
|
GDK_TOPLEVEL_STATE_RIGHT_TILED |
|
|
|
|
|
GDK_TOPLEVEL_STATE_BOTTOM_TILED |
|
|
|
|
|
GDK_TOPLEVEL_STATE_LEFT_TILED |
|
|
|
|
|
GDK_TOPLEVEL_STATE_MINIMIZED));
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-30 21:06:59 +00:00
|
|
|
|
static void
|
|
|
|
|
toplevel_compute_size (GdkToplevel *toplevel,
|
|
|
|
|
GdkToplevelSize *size,
|
|
|
|
|
GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
int width, height;
|
|
|
|
|
GtkBorder shadow;
|
2020-08-07 08:11:10 +00:00
|
|
|
|
int bounds_width, bounds_height;
|
2020-07-30 21:06:59 +00:00
|
|
|
|
int min_width, min_height;
|
2020-10-06 15:05:40 +00:00
|
|
|
|
int nat_width, nat_height;
|
2020-07-30 21:06:59 +00:00
|
|
|
|
|
2020-08-07 08:11:10 +00:00
|
|
|
|
gdk_toplevel_size_get_bounds (size, &bounds_width, &bounds_height);
|
|
|
|
|
|
|
|
|
|
gtk_window_compute_default_size (window,
|
|
|
|
|
bounds_width, bounds_height,
|
2020-10-06 15:05:40 +00:00
|
|
|
|
&min_width, &min_height,
|
|
|
|
|
&nat_width, &nat_height);
|
2020-08-07 08:11:10 +00:00
|
|
|
|
|
2020-12-05 10:44:51 +00:00
|
|
|
|
width = priv->default_width;
|
|
|
|
|
height = priv->default_height;
|
2020-08-10 14:51:47 +00:00
|
|
|
|
|
2020-12-05 10:44:51 +00:00
|
|
|
|
if (width <= 0)
|
|
|
|
|
width = nat_width;
|
|
|
|
|
if (height <= 0)
|
|
|
|
|
height = nat_height;
|
2020-07-30 21:06:59 +00:00
|
|
|
|
|
2020-12-05 10:44:51 +00:00
|
|
|
|
if (width < min_width)
|
|
|
|
|
width = min_width;
|
|
|
|
|
if (height < min_height)
|
|
|
|
|
height = min_height;
|
2020-12-02 10:59:23 +00:00
|
|
|
|
|
2020-12-05 10:44:51 +00:00
|
|
|
|
if (should_remember_size (window))
|
|
|
|
|
gtk_window_set_default_size_internal (window, TRUE, width, TRUE, height);
|
2020-07-30 21:06:59 +00:00
|
|
|
|
|
2020-12-05 10:44:51 +00:00
|
|
|
|
gtk_window_update_csd_size (window,
|
|
|
|
|
&width, &height,
|
|
|
|
|
INCLUDE_CSD_SIZE);
|
2020-12-02 10:59:23 +00:00
|
|
|
|
gtk_window_update_csd_size (window,
|
|
|
|
|
&min_width, &min_height,
|
|
|
|
|
INCLUDE_CSD_SIZE);
|
2020-10-06 15:05:40 +00:00
|
|
|
|
|
2020-07-30 21:06:59 +00:00
|
|
|
|
gdk_toplevel_size_set_min_size (size, min_width, min_height);
|
2020-11-24 14:51:56 +00:00
|
|
|
|
|
2020-12-05 10:44:51 +00:00
|
|
|
|
gdk_toplevel_size_set_size (size, width, height);
|
2020-12-02 10:59:23 +00:00
|
|
|
|
|
2020-11-24 14:51:56 +00:00
|
|
|
|
if (priv->use_client_shadow)
|
|
|
|
|
{
|
2020-12-02 15:44:59 +00:00
|
|
|
|
get_shadow_width (window, &shadow);
|
2020-12-02 16:08:43 +00:00
|
|
|
|
gdk_toplevel_size_set_shadow_width (size,
|
|
|
|
|
shadow.left, shadow.right,
|
|
|
|
|
shadow.top, shadow.bottom);
|
2020-11-24 14:51:56 +00:00
|
|
|
|
}
|
2020-12-02 10:59:23 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_ensure_resize (widget);
|
2020-07-30 21:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-04-22 21:28:23 +00:00
|
|
|
|
static void
|
2014-09-17 22:16:45 +00:00
|
|
|
|
gtk_window_realize (GtkWidget *widget)
|
2013-04-22 21:28:23 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2018-03-21 10:49:14 +00:00
|
|
|
|
GdkSurface *surface;
|
2013-04-22 21:28:23 +00:00
|
|
|
|
|
2020-05-20 08:11:37 +00:00
|
|
|
|
/* Create default title bar */
|
2014-09-17 22:16:45 +00:00
|
|
|
|
if (!priv->client_decorated && gtk_window_should_use_csd (window))
|
2020-05-20 08:11:37 +00:00
|
|
|
|
{
|
|
|
|
|
priv->use_client_shadow = gtk_window_supports_client_shadow (window);
|
|
|
|
|
if (priv->use_client_shadow)
|
|
|
|
|
{
|
|
|
|
|
gtk_window_enable_csd (window);
|
|
|
|
|
|
|
|
|
|
if (priv->title_box == NULL)
|
|
|
|
|
{
|
|
|
|
|
priv->titlebar = gtk_header_bar_new ();
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (priv->titlebar, "titlebar");
|
2020-05-20 08:11:37 +00:00
|
|
|
|
gtk_widget_add_css_class (priv->titlebar, "default-decoration");
|
|
|
|
|
|
2020-08-01 07:30:48 +00:00
|
|
|
|
gtk_widget_insert_before (priv->titlebar, widget, NULL);
|
2020-05-20 08:11:37 +00:00
|
|
|
|
priv->title_box = priv->titlebar;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
update_window_actions (window);
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-04-22 21:28:23 +00:00
|
|
|
|
|
2020-07-30 21:06:59 +00:00
|
|
|
|
surface = gdk_surface_new_toplevel (gtk_widget_get_display (widget));
|
2019-05-26 17:43:46 +00:00
|
|
|
|
priv->surface = surface;
|
2019-04-19 20:14:09 +00:00
|
|
|
|
gdk_surface_set_widget (surface, widget);
|
|
|
|
|
|
2020-09-28 18:47:32 +00:00
|
|
|
|
if (priv->renderer == NULL)
|
|
|
|
|
priv->renderer = gsk_renderer_new_for_surface (surface);
|
|
|
|
|
|
2018-03-21 10:49:14 +00:00
|
|
|
|
g_signal_connect_swapped (surface, "notify::state", G_CALLBACK (surface_state_changed), widget);
|
gdk: Replace 'WITHDRAWN' state with async 'is-mapped' boolean
It was used by all surfaces to track 'is-mapped', but still part of the
GdkToplevelState, and is now replaced with a separate boolean in the
GdkSurface structure.
It also caused issues when a widget was unmapped, and due to that
unmapped a popover which hid its corresponding surface. When this
surface was hidden, it emitted a state change event, which would then go
back into GTK and queue a resize on popover widget, which would travel
back down to the widget that was originally unmapped, causing confusino
when doing future allocations.
To summarize, one should not hide widgets during allocation, and to
avoid this, make this new is-mapped boolean asynchronous when hiding a
surface, meaning the notification event for the changed mapped state
will be emitted in an idle callback. This avoids the above described
reentry issue.
2020-12-07 17:18:38 +00:00
|
|
|
|
g_signal_connect_swapped (surface, "notify::mapped", G_CALLBACK (surface_state_changed), widget);
|
2019-04-19 20:14:09 +00:00
|
|
|
|
g_signal_connect (surface, "render", G_CALLBACK (surface_render), widget);
|
|
|
|
|
g_signal_connect (surface, "event", G_CALLBACK (surface_event), widget);
|
2020-07-30 21:06:59 +00:00
|
|
|
|
g_signal_connect (surface, "compute-size", G_CALLBACK (toplevel_compute_size), widget);
|
2018-04-11 00:43:19 +00:00
|
|
|
|
|
|
|
|
|
GTK_WIDGET_CLASS (gtk_window_parent_class)->realize (widget);
|
2014-09-17 22:16:45 +00:00
|
|
|
|
|
2020-04-26 01:03:57 +00:00
|
|
|
|
gtk_root_start_layout (GTK_ROOT (window));
|
2020-04-19 15:43:57 +00:00
|
|
|
|
|
2014-09-17 22:16:45 +00:00
|
|
|
|
if (priv->transient_parent &&
|
2015-09-06 23:58:03 +00:00
|
|
|
|
_gtk_widget_get_realized (GTK_WIDGET (priv->transient_parent)))
|
2019-05-20 00:38:08 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *parent_priv = gtk_window_get_instance_private (priv->transient_parent);
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_set_transient_for (GDK_TOPLEVEL (surface), parent_priv->surface);
|
2019-05-20 00:38:08 +00:00
|
|
|
|
}
|
2014-09-17 22:16:45 +00:00
|
|
|
|
|
2016-11-04 03:08:50 +00:00
|
|
|
|
if (priv->title)
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_set_title (GDK_TOPLEVEL (surface), priv->title);
|
2016-11-04 03:08:50 +00:00
|
|
|
|
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_set_decorated (GDK_TOPLEVEL (surface), priv->decorated && !priv->client_decorated);
|
|
|
|
|
gdk_toplevel_set_deletable (GDK_TOPLEVEL (surface), priv->deletable);
|
2014-09-17 22:16:45 +00:00
|
|
|
|
|
2017-04-29 00:35:51 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_WAYLAND
|
2021-01-22 03:43:33 +00:00
|
|
|
|
if (GDK_IS_WAYLAND_SURFACE (surface))
|
|
|
|
|
{
|
|
|
|
|
if (priv->client_decorated)
|
|
|
|
|
gdk_wayland_toplevel_announce_csd (GDK_TOPLEVEL (surface));
|
|
|
|
|
else
|
|
|
|
|
gdk_wayland_toplevel_announce_ssd (GDK_TOPLEVEL (surface));
|
|
|
|
|
}
|
2017-04-29 00:35:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_set_modal (GDK_TOPLEVEL (surface), priv->modal);
|
2013-04-21 03:37:10 +00:00
|
|
|
|
|
2014-09-17 22:16:45 +00:00
|
|
|
|
if (priv->startup_id)
|
|
|
|
|
{
|
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
2018-03-21 10:49:14 +00:00
|
|
|
|
if (GDK_IS_X11_SURFACE (surface))
|
2013-04-21 03:37:10 +00:00
|
|
|
|
{
|
2014-09-17 22:16:45 +00:00
|
|
|
|
guint32 timestamp = extract_time_from_startup_id (priv->startup_id);
|
|
|
|
|
if (timestamp != GDK_CURRENT_TIME)
|
2018-03-21 10:49:14 +00:00
|
|
|
|
gdk_x11_surface_set_user_time (surface, timestamp);
|
2013-04-21 03:37:10 +00:00
|
|
|
|
}
|
2014-09-17 22:16:45 +00:00
|
|
|
|
#endif
|
|
|
|
|
if (!startup_id_is_fake (priv->startup_id))
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_set_startup_id (GDK_TOPLEVEL (surface), priv->startup_id);
|
2013-04-21 03:37:10 +00:00
|
|
|
|
}
|
2014-09-17 22:16:45 +00:00
|
|
|
|
|
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
|
|
|
|
if (priv->initial_timestamp != GDK_CURRENT_TIME)
|
2013-04-21 03:37:10 +00:00
|
|
|
|
{
|
2018-03-21 10:49:14 +00:00
|
|
|
|
if (GDK_IS_X11_SURFACE (surface))
|
|
|
|
|
gdk_x11_surface_set_user_time (surface, priv->initial_timestamp);
|
2013-04-21 03:37:10 +00:00
|
|
|
|
}
|
2014-09-17 22:16:45 +00:00
|
|
|
|
#endif
|
2014-03-12 04:15:02 +00:00
|
|
|
|
|
2020-05-20 07:30:01 +00:00
|
|
|
|
update_realized_window_properties (window);
|
2013-04-21 03:37:10 +00:00
|
|
|
|
|
2014-09-17 22:16:45 +00:00
|
|
|
|
if (priv->application)
|
|
|
|
|
gtk_application_handle_window_realize (priv->application, window);
|
2013-08-08 20:29:02 +00:00
|
|
|
|
|
2014-09-17 22:16:45 +00:00
|
|
|
|
/* Icons */
|
|
|
|
|
gtk_window_realize_icon (window);
|
2013-08-08 20:29:02 +00:00
|
|
|
|
|
2014-09-17 22:16:45 +00:00
|
|
|
|
check_scale_changed (window);
|
2020-12-02 10:59:23 +00:00
|
|
|
|
|
|
|
|
|
gtk_native_realize (GTK_NATIVE (window));
|
2013-08-08 20:29:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-08-22 17:20:10 +00:00
|
|
|
|
static void
|
2014-09-17 22:16:45 +00:00
|
|
|
|
gtk_window_unrealize (GtkWidget *widget)
|
2013-08-22 17:20:10 +00:00
|
|
|
|
{
|
2014-09-17 22:16:45 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2014-09-17 22:16:45 +00:00
|
|
|
|
GtkWindowGeometryInfo *info;
|
2019-04-19 20:14:09 +00:00
|
|
|
|
GdkSurface *surface;
|
2013-08-22 17:20:10 +00:00
|
|
|
|
|
2020-12-02 10:59:23 +00:00
|
|
|
|
gtk_native_unrealize (GTK_NATIVE (window));
|
|
|
|
|
|
2014-09-17 22:16:45 +00:00
|
|
|
|
/* On unrealize, we reset the size of the window such
|
|
|
|
|
* that we will re-apply the default sizing stuff
|
|
|
|
|
* next time we show the window.
|
|
|
|
|
*
|
|
|
|
|
* Default positioning is reset on unmap, instead of unrealize.
|
|
|
|
|
*/
|
|
|
|
|
priv->need_default_size = TRUE;
|
|
|
|
|
info = gtk_window_get_geometry_info (window, FALSE);
|
|
|
|
|
if (info)
|
|
|
|
|
{
|
|
|
|
|
info->last.configure_request.x = 0;
|
|
|
|
|
info->last.configure_request.y = 0;
|
|
|
|
|
info->last.configure_request.width = -1;
|
|
|
|
|
info->last.configure_request.height = -1;
|
|
|
|
|
/* be sure we reset geom hints on re-realize */
|
|
|
|
|
info->last.flags = 0;
|
|
|
|
|
}
|
2013-08-22 17:20:10 +00:00
|
|
|
|
|
2019-10-22 23:52:14 +00:00
|
|
|
|
gsk_renderer_unrealize (priv->renderer);
|
|
|
|
|
|
2014-09-17 22:16:45 +00:00
|
|
|
|
/* Icons */
|
|
|
|
|
gtk_window_unrealize_icon (window);
|
2013-08-22 17:20:10 +00:00
|
|
|
|
|
2020-05-02 19:17:20 +00:00
|
|
|
|
if (priv->title_box)
|
|
|
|
|
gtk_widget_unrealize (priv->title_box);
|
|
|
|
|
|
|
|
|
|
if (priv->child)
|
|
|
|
|
gtk_widget_unrealize (priv->child);
|
2016-11-15 05:43:47 +00:00
|
|
|
|
|
2017-11-01 14:46:20 +00:00
|
|
|
|
g_clear_object (&priv->renderer);
|
2016-11-23 07:25:42 +00:00
|
|
|
|
|
2019-05-17 21:25:36 +00:00
|
|
|
|
surface = priv->surface;
|
2019-04-19 20:14:09 +00:00
|
|
|
|
|
|
|
|
|
g_signal_handlers_disconnect_by_func (surface, surface_state_changed, widget);
|
|
|
|
|
g_signal_handlers_disconnect_by_func (surface, surface_render, widget);
|
|
|
|
|
g_signal_handlers_disconnect_by_func (surface, surface_event, widget);
|
2019-05-18 13:39:12 +00:00
|
|
|
|
|
2020-04-26 01:03:57 +00:00
|
|
|
|
gtk_root_stop_layout (GTK_ROOT (window));
|
2020-04-19 15:43:57 +00:00
|
|
|
|
|
2019-05-18 13:39:12 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_window_parent_class)->unrealize (widget);
|
|
|
|
|
|
2019-04-19 20:14:09 +00:00
|
|
|
|
gdk_surface_set_widget (surface, NULL);
|
2019-05-17 21:25:36 +00:00
|
|
|
|
gdk_surface_destroy (surface);
|
|
|
|
|
g_clear_object (&priv->surface);
|
2013-08-22 17:20:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2014-09-17 22:16:45 +00:00
|
|
|
|
update_window_style_classes (GtkWindow *window)
|
2013-08-22 17:20:10 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-01-29 11:11:39 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (window);
|
2017-08-18 23:12:23 +00:00
|
|
|
|
guint edge_constraints;
|
2013-08-22 17:20:10 +00:00
|
|
|
|
|
2017-08-18 23:12:23 +00:00
|
|
|
|
edge_constraints = priv->edge_constraints;
|
2013-08-22 17:20:10 +00:00
|
|
|
|
|
2017-08-18 23:12:23 +00:00
|
|
|
|
if (!priv->edge_constraints)
|
|
|
|
|
{
|
|
|
|
|
if (priv->tiled)
|
2020-05-20 17:10:32 +00:00
|
|
|
|
gtk_widget_add_css_class (widget, "tiled");
|
2017-08-18 23:12:23 +00:00
|
|
|
|
else
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_remove_css_class (widget, "tiled");
|
2017-08-18 23:12:23 +00:00
|
|
|
|
}
|
2013-08-22 17:20:10 +00:00
|
|
|
|
else
|
2017-08-18 23:12:23 +00:00
|
|
|
|
{
|
2020-09-10 04:39:03 +00:00
|
|
|
|
if (edge_constraints & GDK_TOPLEVEL_STATE_TOP_TILED)
|
2020-05-20 17:10:32 +00:00
|
|
|
|
gtk_widget_add_css_class (widget, "tiled-top");
|
2017-08-18 23:12:23 +00:00
|
|
|
|
else
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_remove_css_class (widget, "tiled-top");
|
2017-08-18 23:12:23 +00:00
|
|
|
|
|
2020-09-10 04:39:03 +00:00
|
|
|
|
if (edge_constraints & GDK_TOPLEVEL_STATE_RIGHT_TILED)
|
2020-05-20 17:10:32 +00:00
|
|
|
|
gtk_widget_add_css_class (widget, "tiled-right");
|
2017-08-18 23:12:23 +00:00
|
|
|
|
else
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_remove_css_class (widget, "tiled-right");
|
2017-08-18 23:12:23 +00:00
|
|
|
|
|
2020-09-10 04:39:03 +00:00
|
|
|
|
if (edge_constraints & GDK_TOPLEVEL_STATE_BOTTOM_TILED)
|
2020-05-20 17:10:32 +00:00
|
|
|
|
gtk_widget_add_css_class (widget, "tiled-bottom");
|
2017-08-18 23:12:23 +00:00
|
|
|
|
else
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_remove_css_class (widget, "tiled-bottom");
|
2017-08-18 23:12:23 +00:00
|
|
|
|
|
2020-09-10 04:39:03 +00:00
|
|
|
|
if (edge_constraints & GDK_TOPLEVEL_STATE_LEFT_TILED)
|
2020-05-20 17:10:32 +00:00
|
|
|
|
gtk_widget_add_css_class (widget, "tiled-left");
|
2017-08-18 23:12:23 +00:00
|
|
|
|
else
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_remove_css_class (widget, "tiled-left");
|
2017-08-18 23:12:23 +00:00
|
|
|
|
}
|
2013-08-22 17:20:10 +00:00
|
|
|
|
|
2014-09-17 22:16:45 +00:00
|
|
|
|
if (priv->maximized)
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_add_css_class (widget, "maximized");
|
2017-12-15 02:07:39 +00:00
|
|
|
|
else
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_remove_css_class (widget, "maximized");
|
2017-12-15 02:07:39 +00:00
|
|
|
|
|
2014-09-26 22:08:46 +00:00
|
|
|
|
if (priv->fullscreen)
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_add_css_class (widget, "fullscreen");
|
2014-09-26 22:08:46 +00:00
|
|
|
|
else
|
2020-02-06 16:32:26 +00:00
|
|
|
|
gtk_widget_remove_css_class (widget, "fullscreen");
|
2013-08-22 17:20:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-01-20 06:01:08 +00:00
|
|
|
|
/* _gtk_window_set_allocation:
|
|
|
|
|
* @window: a #GtkWindow
|
2013-02-26 19:33:04 +00:00
|
|
|
|
* @allocation: the original allocation for the window
|
|
|
|
|
* @allocation_out: @allocation taking decorations into
|
|
|
|
|
* consideration
|
2012-01-20 06:01:08 +00:00
|
|
|
|
*
|
|
|
|
|
* This function is like gtk_widget_set_allocation()
|
|
|
|
|
* but does the necessary extra work to update
|
|
|
|
|
* the resize grip positioning, etc.
|
|
|
|
|
*
|
|
|
|
|
* Call this instead of gtk_widget_set_allocation()
|
|
|
|
|
* when overriding ::size_allocate in a GtkWindow
|
|
|
|
|
* subclass without chaining up.
|
2013-02-26 19:33:04 +00:00
|
|
|
|
*
|
|
|
|
|
* The @allocation parameter will be adjusted to
|
|
|
|
|
* reflect any internal decorations that the window
|
|
|
|
|
* may have. That revised allocation will then be
|
|
|
|
|
* returned in the @allocation_out parameter.
|
2012-01-20 06:01:08 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2013-02-26 19:33:04 +00:00
|
|
|
|
_gtk_window_set_allocation (GtkWindow *window,
|
2018-08-16 04:53:03 +00:00
|
|
|
|
int width,
|
|
|
|
|
int height,
|
2013-02-26 19:33:04 +00:00
|
|
|
|
GtkAllocation *allocation_out)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2012-01-20 06:01:08 +00:00
|
|
|
|
GtkWidget *widget = (GtkWidget *)window;
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2012-04-11 16:55:54 +00:00
|
|
|
|
GtkAllocation child_allocation;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2013-02-26 19:33:04 +00:00
|
|
|
|
g_assert (allocation_out != NULL);
|
|
|
|
|
|
2013-03-24 01:06:14 +00:00
|
|
|
|
child_allocation.x = 0;
|
|
|
|
|
child_allocation.y = 0;
|
2018-08-16 04:53:03 +00:00
|
|
|
|
child_allocation.width = width;
|
|
|
|
|
child_allocation.height = height;
|
2012-04-11 16:55:54 +00:00
|
|
|
|
|
2015-09-06 23:58:03 +00:00
|
|
|
|
if (_gtk_widget_get_realized (widget))
|
2020-05-02 06:41:20 +00:00
|
|
|
|
{
|
2020-05-20 07:32:44 +00:00
|
|
|
|
update_realized_window_properties (window);
|
2020-05-02 06:41:20 +00:00
|
|
|
|
}
|
2013-08-08 20:29:02 +00:00
|
|
|
|
|
2014-09-17 22:16:45 +00:00
|
|
|
|
priv->title_height = 0;
|
2013-08-22 17:20:10 +00:00
|
|
|
|
|
2012-04-11 16:55:54 +00:00
|
|
|
|
if (priv->title_box != NULL &&
|
2014-02-04 12:52:11 +00:00
|
|
|
|
gtk_widget_get_visible (priv->title_box) &&
|
|
|
|
|
gtk_widget_get_child_visible (priv->title_box) &&
|
2013-01-31 17:24:31 +00:00
|
|
|
|
priv->decorated &&
|
|
|
|
|
!priv->fullscreen)
|
2012-04-11 16:55:54 +00:00
|
|
|
|
{
|
|
|
|
|
GtkAllocation title_allocation;
|
|
|
|
|
|
2020-05-02 06:41:20 +00:00
|
|
|
|
title_allocation.x = 0;
|
|
|
|
|
title_allocation.y = 0;
|
|
|
|
|
title_allocation.width = width;
|
2013-03-17 22:35:21 +00:00
|
|
|
|
|
2016-11-12 13:34:53 +00:00
|
|
|
|
gtk_widget_measure (priv->title_box, GTK_ORIENTATION_VERTICAL,
|
|
|
|
|
title_allocation.width,
|
|
|
|
|
NULL, &priv->title_height,
|
|
|
|
|
NULL, NULL);
|
2013-03-17 22:35:21 +00:00
|
|
|
|
|
2013-05-26 01:02:00 +00:00
|
|
|
|
title_allocation.height = priv->title_height;
|
2012-04-11 16:55:54 +00:00
|
|
|
|
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (priv->title_box, &title_allocation, -1);
|
2012-04-11 16:55:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-03-18 12:38:02 +00:00
|
|
|
|
if (priv->decorated &&
|
2013-01-31 17:24:31 +00:00
|
|
|
|
!priv->fullscreen)
|
2012-04-11 16:55:54 +00:00
|
|
|
|
{
|
2020-05-02 06:41:20 +00:00
|
|
|
|
child_allocation.y += priv->title_height;
|
|
|
|
|
child_allocation.height -= priv->title_height;
|
2012-04-11 16:55:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*allocation_out = child_allocation;
|
2013-11-07 22:49:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-11-14 18:35:47 +00:00
|
|
|
|
static void
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_window_size_allocate (GtkWidget *widget,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
int baseline)
|
2012-11-14 18:35:47 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
2020-05-02 19:17:20 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
GtkWidget *child = priv->child;
|
2012-04-11 16:55:54 +00:00
|
|
|
|
GtkAllocation child_allocation;
|
2012-11-14 18:35:47 +00:00
|
|
|
|
|
2018-08-16 04:53:03 +00:00
|
|
|
|
_gtk_window_set_allocation (window, width, height, &child_allocation);
|
2012-11-14 18:35:47 +00:00
|
|
|
|
|
|
|
|
|
if (child && gtk_widget_get_visible (child))
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (child, &child_allocation, -1);
|
2020-05-06 17:56:27 +00:00
|
|
|
|
|
|
|
|
|
gtk_tooltip_maybe_allocate (GTK_NATIVE (widget));
|
2012-11-14 18:35:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-08-17 03:30:31 +00:00
|
|
|
|
static void
|
2017-12-15 02:07:39 +00:00
|
|
|
|
update_edge_constraints (GtkWindow *window,
|
2020-09-10 04:39:03 +00:00
|
|
|
|
GdkToplevelState state)
|
2017-08-17 03:30:31 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2017-08-17 03:30:31 +00:00
|
|
|
|
|
2020-09-10 04:39:03 +00:00
|
|
|
|
priv->edge_constraints = (state & GDK_TOPLEVEL_STATE_TOP_TILED) |
|
|
|
|
|
(state & GDK_TOPLEVEL_STATE_TOP_RESIZABLE) |
|
|
|
|
|
(state & GDK_TOPLEVEL_STATE_RIGHT_TILED) |
|
|
|
|
|
(state & GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE) |
|
|
|
|
|
(state & GDK_TOPLEVEL_STATE_BOTTOM_TILED) |
|
|
|
|
|
(state & GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE) |
|
|
|
|
|
(state & GDK_TOPLEVEL_STATE_LEFT_TILED) |
|
|
|
|
|
(state & GDK_TOPLEVEL_STATE_LEFT_RESIZABLE);
|
2017-08-17 03:30:31 +00:00
|
|
|
|
|
2020-09-10 04:39:03 +00:00
|
|
|
|
priv->tiled = (state & GDK_TOPLEVEL_STATE_TILED) ? 1 : 0;
|
2017-08-17 03:30:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-12-15 02:07:39 +00:00
|
|
|
|
static void
|
2018-03-20 11:05:26 +00:00
|
|
|
|
surface_state_changed (GtkWidget *widget)
|
2010-10-08 05:43:03 +00:00
|
|
|
|
{
|
2013-01-31 17:24:31 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-09-10 04:39:03 +00:00
|
|
|
|
GdkToplevelState new_surface_state;
|
|
|
|
|
GdkToplevelState changed_mask;
|
2017-12-15 02:07:39 +00:00
|
|
|
|
|
2020-03-01 01:32:15 +00:00
|
|
|
|
new_surface_state = gdk_toplevel_get_state (GDK_TOPLEVEL (priv->surface));
|
2018-03-20 11:05:26 +00:00
|
|
|
|
changed_mask = new_surface_state ^ priv->state;
|
|
|
|
|
priv->state = new_surface_state;
|
2013-01-31 17:24:31 +00:00
|
|
|
|
|
2020-09-10 04:39:03 +00:00
|
|
|
|
if (changed_mask & GDK_TOPLEVEL_STATE_FOCUSED)
|
2020-04-02 21:21:01 +00:00
|
|
|
|
{
|
2020-09-10 04:39:03 +00:00
|
|
|
|
gboolean focused = new_surface_state & GDK_TOPLEVEL_STATE_FOCUSED;
|
2020-04-02 21:21:01 +00:00
|
|
|
|
|
|
|
|
|
ensure_state_flag_backdrop (widget);
|
|
|
|
|
|
|
|
|
|
if (!focused)
|
|
|
|
|
gtk_window_set_mnemonics_visible (window, FALSE);
|
|
|
|
|
}
|
2011-10-28 22:45:38 +00:00
|
|
|
|
|
2020-09-10 04:39:03 +00:00
|
|
|
|
if (changed_mask & GDK_TOPLEVEL_STATE_FULLSCREEN)
|
2020-10-23 15:51:02 +00:00
|
|
|
|
{
|
|
|
|
|
priv->fullscreen = (new_surface_state & GDK_TOPLEVEL_STATE_FULLSCREEN) ? TRUE : FALSE;
|
2020-12-05 11:22:25 +00:00
|
|
|
|
|
2020-12-09 00:11:49 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (widget), window_props[PROP_FULLSCREENED]);
|
2020-10-23 15:51:02 +00:00
|
|
|
|
}
|
2013-01-31 17:24:31 +00:00
|
|
|
|
|
2020-09-10 04:39:03 +00:00
|
|
|
|
if (changed_mask & GDK_TOPLEVEL_STATE_MAXIMIZED)
|
2013-10-06 04:41:27 +00:00
|
|
|
|
{
|
2020-09-10 04:39:03 +00:00
|
|
|
|
priv->maximized = (new_surface_state & GDK_TOPLEVEL_STATE_MAXIMIZED) ? TRUE : FALSE;
|
2020-10-23 15:51:02 +00:00
|
|
|
|
|
2020-12-05 11:11:25 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (widget), window_props[PROP_MAXIMIZED]);
|
2013-10-06 04:41:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-20 11:05:26 +00:00
|
|
|
|
update_edge_constraints (window, new_surface_state);
|
2017-08-17 03:30:31 +00:00
|
|
|
|
|
2020-09-10 04:39:03 +00:00
|
|
|
|
if (changed_mask & (GDK_TOPLEVEL_STATE_FULLSCREEN |
|
|
|
|
|
GDK_TOPLEVEL_STATE_MAXIMIZED |
|
|
|
|
|
GDK_TOPLEVEL_STATE_TILED |
|
|
|
|
|
GDK_TOPLEVEL_STATE_TOP_TILED |
|
|
|
|
|
GDK_TOPLEVEL_STATE_RIGHT_TILED |
|
|
|
|
|
GDK_TOPLEVEL_STATE_BOTTOM_TILED |
|
|
|
|
|
GDK_TOPLEVEL_STATE_LEFT_TILED |
|
|
|
|
|
GDK_TOPLEVEL_STATE_MINIMIZED))
|
2013-03-10 03:28:39 +00:00
|
|
|
|
{
|
2013-10-06 04:35:05 +00:00
|
|
|
|
update_window_style_classes (window);
|
2020-04-22 17:32:10 +00:00
|
|
|
|
update_window_actions (window);
|
2013-07-05 18:25:30 +00:00
|
|
|
|
gtk_widget_queue_resize (widget);
|
2013-03-10 03:28:39 +00:00
|
|
|
|
}
|
2010-10-08 05:43:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-04-19 20:14:09 +00:00
|
|
|
|
static void
|
|
|
|
|
surface_size_changed (GtkWidget *widget,
|
|
|
|
|
int width,
|
|
|
|
|
int height)
|
|
|
|
|
{
|
2020-12-05 10:44:51 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
2020-05-20 07:32:18 +00:00
|
|
|
|
|
|
|
|
|
check_scale_changed (GTK_WINDOW (widget));
|
|
|
|
|
|
2020-12-05 10:44:51 +00:00
|
|
|
|
if (should_remember_size (window))
|
2020-10-06 00:22:02 +00:00
|
|
|
|
{
|
2020-12-05 10:44:51 +00:00
|
|
|
|
int width_to_remember;
|
|
|
|
|
int height_to_remember;
|
2020-10-06 00:22:02 +00:00
|
|
|
|
|
2020-12-05 10:44:51 +00:00
|
|
|
|
width_to_remember = width;
|
|
|
|
|
height_to_remember = height;
|
|
|
|
|
gtk_window_update_csd_size (window,
|
|
|
|
|
&width_to_remember, &height_to_remember,
|
|
|
|
|
EXCLUDE_CSD_SIZE);
|
|
|
|
|
gtk_window_set_default_size_internal (window,
|
|
|
|
|
TRUE, width_to_remember,
|
|
|
|
|
TRUE, height_to_remember);
|
2020-10-06 00:22:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-05-20 07:32:18 +00:00
|
|
|
|
gtk_widget_queue_allocate (widget);
|
2019-04-19 20:14:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-30 02:41:16 +00:00
|
|
|
|
static void
|
|
|
|
|
maybe_unset_focus_and_default (GtkWindow *window)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
if (priv->move_focus)
|
|
|
|
|
{
|
|
|
|
|
gtk_widget_child_focus (GTK_WIDGET (window), GTK_DIR_TAB_FORWARD);
|
|
|
|
|
priv->move_focus = FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->unset_default)
|
|
|
|
|
{
|
|
|
|
|
gtk_window_set_default_widget (window, NULL);
|
|
|
|
|
priv->unset_default = FALSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-19 20:14:09 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
surface_render (GdkSurface *surface,
|
|
|
|
|
cairo_region_t *region,
|
|
|
|
|
GtkWidget *widget)
|
|
|
|
|
{
|
2021-01-30 02:41:16 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
|
|
|
|
|
2019-04-19 20:14:09 +00:00
|
|
|
|
gtk_widget_render (widget, surface, region);
|
2021-01-30 02:41:16 +00:00
|
|
|
|
maybe_unset_focus_and_default (window);
|
2020-01-22 04:43:01 +00:00
|
|
|
|
|
2019-04-19 20:14:09 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
surface_event (GdkSurface *surface,
|
|
|
|
|
GdkEvent *event,
|
|
|
|
|
GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
gtk_main_do_event (event);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-12 18:00:19 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_real_activate_focus (GtkWindow *window)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
if (priv->focus_widget && gtk_widget_is_sensitive (priv->focus_widget))
|
|
|
|
|
gtk_widget_activate (priv->focus_widget);
|
|
|
|
|
}
|
|
|
|
|
|
2013-04-02 20:33:33 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_window_has_mnemonic_modifier_pressed (GtkWindow *window)
|
2011-04-13 10:26:55 +00:00
|
|
|
|
{
|
2015-12-16 18:26:21 +00:00
|
|
|
|
GList *seats, *s;
|
2013-04-02 20:33:33 +00:00
|
|
|
|
gboolean retval = FALSE;
|
2011-04-13 10:26:55 +00:00
|
|
|
|
|
2015-12-16 18:26:21 +00:00
|
|
|
|
seats = gdk_display_list_seats (gtk_widget_get_display (GTK_WIDGET (window)));
|
2011-04-13 10:26:55 +00:00
|
|
|
|
|
2015-12-16 18:26:21 +00:00
|
|
|
|
for (s = seats; s; s = s->next)
|
2011-04-13 10:26:55 +00:00
|
|
|
|
{
|
2020-07-28 13:46:05 +00:00
|
|
|
|
GdkDevice *dev = gdk_seat_get_keyboard (s->data);
|
2015-12-16 18:26:21 +00:00
|
|
|
|
GdkModifierType mask;
|
2011-04-13 10:26:55 +00:00
|
|
|
|
|
2020-07-28 13:46:05 +00:00
|
|
|
|
mask = gdk_device_get_modifier_state (dev);
|
2020-04-05 13:39:03 +00:00
|
|
|
|
if ((mask & gtk_accelerator_get_default_mod_mask ()) == GDK_ALT_MASK)
|
2011-04-13 10:26:55 +00:00
|
|
|
|
{
|
2015-12-16 18:26:21 +00:00
|
|
|
|
retval = TRUE;
|
|
|
|
|
break;
|
2011-04-13 10:26:55 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-16 18:26:21 +00:00
|
|
|
|
g_list_free (seats);
|
2013-04-02 20:33:33 +00:00
|
|
|
|
|
|
|
|
|
return retval;
|
2011-04-13 10:26:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-15 18:43:00 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_window_handle_focus (GtkWidget *widget,
|
|
|
|
|
GdkEvent *event,
|
|
|
|
|
double x,
|
|
|
|
|
double y)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2001-04-19 20:36:46 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
2020-04-15 18:43:00 +00:00
|
|
|
|
if (gdk_event_get_event_type (event) != GDK_FOCUS_CHANGE)
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
if (gdk_focus_event_get_in (event))
|
1997-11-24 22:37:52 +00:00
|
|
|
|
{
|
2020-02-20 01:51:03 +00:00
|
|
|
|
_gtk_window_set_is_active (window, TRUE);
|
2011-04-13 10:26:55 +00:00
|
|
|
|
|
2020-02-20 01:51:03 +00:00
|
|
|
|
if (gtk_window_has_mnemonic_modifier_pressed (window))
|
|
|
|
|
_gtk_window_schedule_mnemonics_visible (window);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
2020-04-15 18:43:00 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_gtk_window_set_is_active (window, FALSE);
|
2020-02-20 01:51:03 +00:00
|
|
|
|
|
2020-04-15 18:43:00 +00:00
|
|
|
|
gtk_window_set_mnemonics_visible (window, FALSE);
|
|
|
|
|
}
|
2020-02-20 01:51:03 +00:00
|
|
|
|
|
2020-04-15 18:43:00 +00:00
|
|
|
|
return TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-06-21 02:22:26 +00:00
|
|
|
|
static void
|
|
|
|
|
update_mnemonics_visible (GtkWindow *window,
|
|
|
|
|
guint keyval,
|
|
|
|
|
GdkModifierType state,
|
|
|
|
|
gboolean visible)
|
|
|
|
|
{
|
|
|
|
|
if ((keyval == GDK_KEY_Alt_L || keyval == GDK_KEY_Alt_R) &&
|
2020-04-05 13:39:03 +00:00
|
|
|
|
((state & (gtk_accelerator_get_default_mod_mask ()) & ~(GDK_ALT_MASK)) == 0))
|
2019-06-21 02:22:26 +00:00
|
|
|
|
{
|
|
|
|
|
if (visible)
|
|
|
|
|
_gtk_window_schedule_mnemonics_visible (window);
|
|
|
|
|
else
|
|
|
|
|
gtk_window_set_mnemonics_visible (window, FALSE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-21 22:14:40 +00:00
|
|
|
|
static void
|
|
|
|
|
update_focus_visible (GtkWindow *window,
|
|
|
|
|
guint keyval,
|
|
|
|
|
GdkModifierType state,
|
|
|
|
|
gboolean visible)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
if (visible)
|
|
|
|
|
{
|
|
|
|
|
if (priv->focus_visible)
|
|
|
|
|
priv->key_press_focus = NULL;
|
|
|
|
|
else
|
|
|
|
|
priv->key_press_focus = priv->focus_widget;
|
|
|
|
|
|
|
|
|
|
if ((keyval == GDK_KEY_Alt_L || keyval == GDK_KEY_Alt_R) &&
|
|
|
|
|
((state & (gtk_accelerator_get_default_mod_mask ()) & ~(GDK_ALT_MASK)) == 0))
|
|
|
|
|
gtk_window_set_focus_visible (window, TRUE);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (priv->key_press_focus == priv->focus_widget)
|
|
|
|
|
gtk_window_set_focus_visible (window, FALSE);
|
|
|
|
|
else
|
|
|
|
|
gtk_window_set_focus_visible (window, TRUE);
|
|
|
|
|
|
|
|
|
|
priv->key_press_focus = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-21 01:57:51 +00:00
|
|
|
|
static gboolean
|
2019-06-21 02:55:27 +00:00
|
|
|
|
gtk_window_key_pressed (GtkWidget *widget,
|
|
|
|
|
guint keyval,
|
|
|
|
|
guint keycode,
|
|
|
|
|
GdkModifierType state,
|
|
|
|
|
gpointer data)
|
2019-06-21 01:57:51 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
|
|
|
|
|
2020-04-21 22:14:40 +00:00
|
|
|
|
update_focus_visible (window, keyval, state, TRUE);
|
2019-06-21 02:22:26 +00:00
|
|
|
|
update_mnemonics_visible (window, keyval, state, TRUE);
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
|
gtk_window_key_released (GtkWidget *widget,
|
|
|
|
|
guint keyval,
|
|
|
|
|
guint keycode,
|
|
|
|
|
GdkModifierType state,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
|
|
|
|
|
2020-04-21 22:14:40 +00:00
|
|
|
|
update_focus_visible (window, keyval, state, FALSE);
|
2019-06-21 02:22:26 +00:00
|
|
|
|
update_mnemonics_visible (window, keyval, state, FALSE);
|
|
|
|
|
|
2019-06-21 01:57:51 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
static gboolean
|
2001-06-08 18:09:34 +00:00
|
|
|
|
gtk_window_focus (GtkWidget *widget,
|
2020-05-02 19:17:20 +00:00
|
|
|
|
GtkDirectionType direction)
|
2000-12-11 17:47:24 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-05-24 20:31:36 +00:00
|
|
|
|
GtkWidget *child;
|
2001-06-08 18:09:34 +00:00
|
|
|
|
GtkWidget *old_focus_child;
|
2000-12-11 17:47:24 +00:00
|
|
|
|
GtkWidget *parent;
|
2001-06-08 18:09:34 +00:00
|
|
|
|
|
2017-02-08 08:00:29 +00:00
|
|
|
|
old_focus_child = gtk_widget_get_focus_child (widget);
|
2013-09-16 18:26:08 +00:00
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/* We need a special implementation here to deal properly with wrapping
|
|
|
|
|
* around in the tab chain without the danger of going into an
|
|
|
|
|
* infinite loop.
|
|
|
|
|
*/
|
|
|
|
|
if (old_focus_child)
|
|
|
|
|
{
|
2001-06-08 18:09:34 +00:00
|
|
|
|
if (gtk_widget_child_focus (old_focus_child, direction))
|
2019-06-11 13:14:25 +00:00
|
|
|
|
return TRUE;
|
2000-12-11 17:47:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
if (priv->focus_widget)
|
2000-12-11 17:47:24 +00:00
|
|
|
|
{
|
2003-04-02 21:50:45 +00:00
|
|
|
|
if (direction == GTK_DIR_LEFT ||
|
2020-05-02 19:17:20 +00:00
|
|
|
|
direction == GTK_DIR_RIGHT ||
|
|
|
|
|
direction == GTK_DIR_UP ||
|
|
|
|
|
direction == GTK_DIR_DOWN)
|
|
|
|
|
{
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-11 17:47:24 +00:00
|
|
|
|
/* Wrapped off the end, clear the focus setting for the toplpevel */
|
2015-09-06 23:58:03 +00:00
|
|
|
|
parent = _gtk_widget_get_parent (priv->focus_widget);
|
2000-12-11 17:47:24 +00:00
|
|
|
|
while (parent)
|
2020-05-02 19:17:20 +00:00
|
|
|
|
{
|
2017-02-08 08:00:29 +00:00
|
|
|
|
gtk_widget_set_focus_child (parent, NULL);
|
2020-05-02 19:17:20 +00:00
|
|
|
|
parent = _gtk_widget_get_parent (parent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_window_set_focus (window, NULL);
|
2000-12-11 17:47:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-09-16 18:26:08 +00:00
|
|
|
|
/* Now try to focus the first widget in the window,
|
|
|
|
|
* taking care to hook titlebar widgets into the
|
|
|
|
|
* focus chain.
|
|
|
|
|
*/
|
|
|
|
|
if (priv->title_box != NULL &&
|
|
|
|
|
old_focus_child != NULL &&
|
|
|
|
|
priv->title_box != old_focus_child)
|
|
|
|
|
child = priv->title_box;
|
|
|
|
|
else
|
2020-05-02 19:17:20 +00:00
|
|
|
|
child = priv->child;
|
2013-09-16 18:26:08 +00:00
|
|
|
|
|
2010-05-24 20:31:36 +00:00
|
|
|
|
if (child)
|
2000-12-11 17:47:24 +00:00
|
|
|
|
{
|
2010-05-24 20:31:36 +00:00
|
|
|
|
if (gtk_widget_child_focus (child, direction))
|
2001-06-08 18:09:34 +00:00
|
|
|
|
return TRUE;
|
2018-07-26 08:16:32 +00:00
|
|
|
|
else if (priv->title_box != NULL &&
|
|
|
|
|
priv->title_box != child &&
|
|
|
|
|
gtk_widget_child_focus (priv->title_box, direction))
|
|
|
|
|
return TRUE;
|
2019-06-11 13:14:25 +00:00
|
|
|
|
else if (priv->title_box == child &&
|
2020-05-02 19:17:20 +00:00
|
|
|
|
gtk_widget_child_focus (priv->child, direction))
|
2019-06-11 13:14:25 +00:00
|
|
|
|
return TRUE;
|
2000-12-11 17:47:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-20 14:58:18 +00:00
|
|
|
|
static void
|
2013-07-05 18:24:38 +00:00
|
|
|
|
gtk_window_move_focus (GtkWidget *widget,
|
|
|
|
|
GtkDirectionType dir)
|
2010-10-20 14:58:18 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_widget_child_focus (widget, dir);
|
|
|
|
|
|
2017-02-08 08:00:29 +00:00
|
|
|
|
if (!gtk_widget_get_focus_child (widget))
|
2010-10-20 14:58:18 +00:00
|
|
|
|
gtk_window_set_focus (GTK_WINDOW (widget), NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-21 04:20:58 +00:00
|
|
|
|
void
|
2020-02-19 04:30:16 +00:00
|
|
|
|
check_crossing_invariants (GtkWidget *widget,
|
|
|
|
|
GtkCrossingData *crossing)
|
|
|
|
|
{
|
2020-02-21 04:20:58 +00:00
|
|
|
|
#ifdef G_ENBABLE_DEBUG
|
2020-02-19 04:30:16 +00:00
|
|
|
|
if (crossing->old_target == NULL)
|
|
|
|
|
g_assert (crossing->old_descendent == NULL);
|
|
|
|
|
else if (crossing->old_descendent == NULL)
|
|
|
|
|
g_assert (crossing->old_target == widget || !gtk_widget_is_ancestor (crossing->old_target, widget));
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
g_assert (gtk_widget_get_parent (crossing->old_descendent) == widget);
|
|
|
|
|
g_assert (gtk_widget_is_ancestor (crossing->old_descendent, widget));
|
|
|
|
|
g_assert (crossing->old_target == crossing->old_descendent || gtk_widget_is_ancestor (crossing->old_target, crossing->old_descendent));
|
|
|
|
|
}
|
|
|
|
|
if (crossing->new_target == NULL)
|
|
|
|
|
g_assert (crossing->new_descendent == NULL);
|
|
|
|
|
else if (crossing->new_descendent == NULL)
|
|
|
|
|
g_assert (crossing->new_target == widget || !gtk_widget_is_ancestor (crossing->new_target, widget));
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
g_assert (gtk_widget_get_parent (crossing->new_descendent) == widget);
|
|
|
|
|
g_assert (gtk_widget_is_ancestor (crossing->new_descendent, widget));
|
|
|
|
|
g_assert (crossing->new_target == crossing->new_descendent || gtk_widget_is_ancestor (crossing->new_target, crossing->new_descendent));
|
|
|
|
|
}
|
2020-02-21 04:20:58 +00:00
|
|
|
|
#endif
|
2020-02-19 04:30:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-13 01:26:29 +00:00
|
|
|
|
static void
|
2020-07-30 17:22:26 +00:00
|
|
|
|
synthesize_focus_change_events (GtkWindow *window,
|
|
|
|
|
GtkWidget *old_focus,
|
|
|
|
|
GtkWidget *new_focus,
|
|
|
|
|
GtkCrossingType type)
|
2020-02-13 01:26:29 +00:00
|
|
|
|
{
|
|
|
|
|
GtkCrossingData crossing;
|
2020-02-19 04:30:16 +00:00
|
|
|
|
GtkWidget *ancestor;
|
2020-02-13 01:26:29 +00:00
|
|
|
|
GtkWidget *widget, *focus_child;
|
|
|
|
|
GList *list, *l;
|
|
|
|
|
GtkStateFlags flags;
|
2020-02-19 04:30:16 +00:00
|
|
|
|
GtkWidget *prev;
|
|
|
|
|
gboolean seen_ancestor;
|
|
|
|
|
|
|
|
|
|
if (old_focus && new_focus)
|
|
|
|
|
ancestor = gtk_widget_common_ancestor (old_focus, new_focus);
|
|
|
|
|
else
|
|
|
|
|
ancestor = NULL;
|
2020-02-13 01:26:29 +00:00
|
|
|
|
|
2020-04-16 05:36:13 +00:00
|
|
|
|
flags = GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_FOCUS_WITHIN;
|
2020-02-13 01:26:29 +00:00
|
|
|
|
if (gtk_window_get_focus_visible (GTK_WINDOW (window)))
|
|
|
|
|
flags |= GTK_STATE_FLAG_FOCUS_VISIBLE;
|
|
|
|
|
|
2020-07-30 17:22:26 +00:00
|
|
|
|
crossing.type = type;
|
2020-02-13 01:26:29 +00:00
|
|
|
|
crossing.mode = GDK_CROSSING_NORMAL;
|
|
|
|
|
crossing.old_target = old_focus;
|
2020-02-19 04:30:16 +00:00
|
|
|
|
crossing.old_descendent = NULL;
|
2020-02-13 01:26:29 +00:00
|
|
|
|
crossing.new_target = new_focus;
|
2020-02-19 04:30:16 +00:00
|
|
|
|
crossing.new_descendent = NULL;
|
2020-02-13 01:26:29 +00:00
|
|
|
|
|
|
|
|
|
crossing.direction = GTK_CROSSING_OUT;
|
|
|
|
|
|
2020-02-19 04:30:16 +00:00
|
|
|
|
prev = NULL;
|
|
|
|
|
seen_ancestor = FALSE;
|
2020-02-13 01:26:29 +00:00
|
|
|
|
widget = old_focus;
|
|
|
|
|
while (widget)
|
|
|
|
|
{
|
2020-02-19 04:30:16 +00:00
|
|
|
|
crossing.old_descendent = prev;
|
|
|
|
|
if (seen_ancestor)
|
|
|
|
|
{
|
|
|
|
|
crossing.new_descendent = new_focus ? prev : NULL;
|
|
|
|
|
}
|
|
|
|
|
else if (widget == ancestor)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *w;
|
|
|
|
|
|
|
|
|
|
crossing.new_descendent = NULL;
|
|
|
|
|
for (w = new_focus; w != ancestor; w = gtk_widget_get_parent (w))
|
|
|
|
|
crossing.new_descendent = w;
|
|
|
|
|
|
|
|
|
|
seen_ancestor = TRUE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
crossing.new_descendent = NULL;
|
|
|
|
|
}
|
2020-07-30 17:22:26 +00:00
|
|
|
|
|
2020-02-19 04:30:16 +00:00
|
|
|
|
check_crossing_invariants (widget, &crossing);
|
2020-02-13 01:26:29 +00:00
|
|
|
|
gtk_widget_handle_crossing (widget, &crossing, 0, 0);
|
|
|
|
|
gtk_widget_unset_state_flags (widget, flags);
|
|
|
|
|
gtk_widget_set_focus_child (widget, NULL);
|
2020-02-19 04:30:16 +00:00
|
|
|
|
prev = widget;
|
2020-02-13 01:26:29 +00:00
|
|
|
|
widget = gtk_widget_get_parent (widget);
|
2020-04-16 05:36:13 +00:00
|
|
|
|
|
|
|
|
|
flags = flags & ~GTK_STATE_FLAG_FOCUSED;
|
2020-02-13 01:26:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-16 05:36:13 +00:00
|
|
|
|
flags = GTK_STATE_FLAG_FOCUS_WITHIN;
|
|
|
|
|
if (gtk_window_get_focus_visible (GTK_WINDOW (window)))
|
|
|
|
|
flags |= GTK_STATE_FLAG_FOCUS_VISIBLE;
|
|
|
|
|
|
2020-02-13 01:26:29 +00:00
|
|
|
|
list = NULL;
|
2020-02-19 04:30:16 +00:00
|
|
|
|
for (widget = new_focus; widget; widget = gtk_widget_get_parent (widget))
|
|
|
|
|
list = g_list_prepend (list, widget);
|
2020-02-13 01:26:29 +00:00
|
|
|
|
|
|
|
|
|
crossing.direction = GTK_CROSSING_IN;
|
|
|
|
|
|
2020-02-19 04:30:16 +00:00
|
|
|
|
seen_ancestor = FALSE;
|
2020-02-13 01:26:29 +00:00
|
|
|
|
for (l = list; l; l = l->next)
|
|
|
|
|
{
|
|
|
|
|
widget = l->data;
|
|
|
|
|
if (l->next)
|
|
|
|
|
focus_child = l->next->data;
|
|
|
|
|
else
|
|
|
|
|
focus_child = NULL;
|
2020-02-19 04:30:16 +00:00
|
|
|
|
|
|
|
|
|
crossing.new_descendent = focus_child;
|
|
|
|
|
if (seen_ancestor)
|
|
|
|
|
{
|
|
|
|
|
crossing.old_descendent = NULL;
|
|
|
|
|
}
|
|
|
|
|
else if (widget == ancestor)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *w;
|
|
|
|
|
|
|
|
|
|
crossing.old_descendent = NULL;
|
|
|
|
|
for (w = old_focus; w != ancestor; w = gtk_widget_get_parent (w))
|
|
|
|
|
{
|
|
|
|
|
crossing.old_descendent = w;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
seen_ancestor = TRUE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
crossing.old_descendent = old_focus ? focus_child : NULL;
|
|
|
|
|
}
|
|
|
|
|
check_crossing_invariants (widget, &crossing);
|
2020-02-13 01:26:29 +00:00
|
|
|
|
gtk_widget_handle_crossing (widget, &crossing, 0, 0);
|
2020-04-16 05:36:13 +00:00
|
|
|
|
|
|
|
|
|
if (l->next == NULL)
|
|
|
|
|
flags = flags | GTK_STATE_FLAG_FOCUSED;
|
|
|
|
|
|
2020-02-13 01:26:29 +00:00
|
|
|
|
gtk_widget_set_state_flags (widget, flags, FALSE);
|
|
|
|
|
gtk_widget_set_focus_child (widget, focus_child);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_list_free (list);
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-16 05:28:23 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_focus: (attributes org.gtk.Method.set_property=focus-widget)
|
|
|
|
|
* @window: a `GtkWindow`
|
2019-03-16 05:28:23 +00:00
|
|
|
|
* @focus: (allow-none): widget to be the new focus widget, or %NULL to unset
|
|
|
|
|
* any focus widget for the toplevel window.
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Sets the focus widget.
|
|
|
|
|
*
|
|
|
|
|
* If @focus is not the current focus widget, and is focusable,
|
|
|
|
|
* sets it as the focus widget for the window. If @focus is %NULL,
|
|
|
|
|
* unsets the focus widget for this window. To set the focus to a
|
|
|
|
|
* particular widget in the toplevel, it is usually more convenient
|
|
|
|
|
* to use [method@Gtk.Widget.grab_focus] instead of this function.
|
|
|
|
|
*/
|
2019-03-16 05:28:23 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_set_focus (GtkWindow *window,
|
|
|
|
|
GtkWidget *focus)
|
2019-03-02 05:54:56 +00:00
|
|
|
|
{
|
2019-03-16 05:28:23 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2020-03-29 19:26:56 +00:00
|
|
|
|
if (focus)
|
|
|
|
|
gtk_widget_grab_focus (focus);
|
|
|
|
|
else
|
|
|
|
|
gtk_window_root_set_focus (GTK_ROOT (window), NULL);
|
1997-12-18 02:17:14 +00:00
|
|
|
|
}
|
2001-04-18 22:21:45 +00:00
|
|
|
|
|
2015-12-02 02:28:36 +00:00
|
|
|
|
static void
|
2020-02-05 01:46:13 +00:00
|
|
|
|
gtk_window_css_changed (GtkWidget *widget,
|
|
|
|
|
GtkCssStyleChange *change)
|
2015-12-02 02:28:36 +00:00
|
|
|
|
{
|
2018-07-13 12:52:43 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
2015-12-02 02:28:36 +00:00
|
|
|
|
|
2020-02-05 01:46:13 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_window_parent_class)->css_changed (widget, change);
|
2015-12-02 02:28:36 +00:00
|
|
|
|
|
2018-07-13 12:52:43 +00:00
|
|
|
|
if (!_gtk_widget_get_alloc_needed (widget) &&
|
|
|
|
|
(change == NULL || gtk_css_style_change_changes_property (change, GTK_CSS_PROPERTY_BACKGROUND_COLOR)))
|
|
|
|
|
{
|
2020-05-20 07:30:01 +00:00
|
|
|
|
GtkBorder shadow;
|
2018-07-13 12:52:43 +00:00
|
|
|
|
|
2020-05-20 07:30:01 +00:00
|
|
|
|
get_shadow_width (window, &shadow);
|
2018-07-13 12:52:43 +00:00
|
|
|
|
|
2020-05-20 07:30:01 +00:00
|
|
|
|
update_opaque_region (window, &shadow);
|
2018-07-13 12:52:43 +00:00
|
|
|
|
}
|
2015-12-02 02:28:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-10-06 01:53:05 +00:00
|
|
|
|
/*
|
2002-11-12 21:08:29 +00:00
|
|
|
|
* _gtk_window_unset_focus_and_default:
|
|
|
|
|
* @window: a #GtkWindow
|
|
|
|
|
* @widget: a widget inside of @window
|
2020-10-06 01:53:05 +00:00
|
|
|
|
*
|
2002-11-12 21:08:29 +00:00
|
|
|
|
* Checks whether the focus and default widgets of @window are
|
|
|
|
|
* @widget or a descendent of @widget, and if so, unset them.
|
2020-10-06 01:53:05 +00:00
|
|
|
|
*/
|
2002-11-12 21:08:29 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_window_unset_focus_and_default (GtkWindow *window,
|
2020-10-06 01:53:05 +00:00
|
|
|
|
GtkWidget *widget)
|
2002-11-12 21:08:29 +00:00
|
|
|
|
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2002-11-12 21:08:29 +00:00
|
|
|
|
GtkWidget *child;
|
2004-02-13 03:03:21 +00:00
|
|
|
|
|
2021-01-30 02:41:16 +00:00
|
|
|
|
child = priv->focus_widget;
|
|
|
|
|
if (child && (child == widget || gtk_widget_is_ancestor (child, widget)))
|
|
|
|
|
priv->move_focus = TRUE;
|
2020-10-06 01:53:05 +00:00
|
|
|
|
|
2010-08-17 13:37:57 +00:00
|
|
|
|
child = priv->default_widget;
|
2021-01-30 02:41:16 +00:00
|
|
|
|
if (child && (child == widget || gtk_widget_is_ancestor (child, widget)))
|
|
|
|
|
priv->unset_default = TRUE;
|
2002-11-12 21:08:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-03-04 20:29:25 +00:00
|
|
|
|
#undef INCLUDE_CSD_SIZE
|
|
|
|
|
#undef EXCLUDE_CSD_SIZE
|
|
|
|
|
|
2001-02-27 20:40:15 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_present:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2001-02-27 20:40:15 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Presents a window to the user.
|
|
|
|
|
*
|
|
|
|
|
* This function should not be used as when it is called,
|
|
|
|
|
* it is too late to gather a valid timestamp to allow focus
|
|
|
|
|
* stealing prevention to work correctly.
|
|
|
|
|
*/
|
2001-02-27 20:40:15 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_present (GtkWindow *window)
|
2005-06-20 18:19:34 +00:00
|
|
|
|
{
|
2005-07-11 18:28:23 +00:00
|
|
|
|
gtk_window_present_with_time (window, GDK_CURRENT_TIME);
|
2005-06-20 18:19:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_window_present_with_time:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
|
|
|
|
* @timestamp: the timestamp of the user interaction (typically a
|
2005-06-20 18:19:34 +00:00
|
|
|
|
* button or key press event) which triggered this call
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Presents a window to the user.
|
2018-07-25 15:18:55 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* This may mean raising the window in the stacking order,
|
|
|
|
|
* unminimizing it, moving it to the current desktop, and/or
|
|
|
|
|
* giving it the keyboard focus, possibly dependent on the user’s
|
|
|
|
|
* platform, window manager, and preferences.
|
|
|
|
|
*
|
|
|
|
|
* If @window is hidden, this function calls [method@Gtk.Widget.show]
|
2018-07-25 15:18:55 +00:00
|
|
|
|
* as well.
|
|
|
|
|
*
|
|
|
|
|
* This function should be used when the user tries to open a window
|
|
|
|
|
* that’s already open. Say for example the preferences dialog is
|
|
|
|
|
* currently open, and the user chooses Preferences from the menu
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* a second time; use [method@Gtk.Window.present] to move the
|
|
|
|
|
* already-open dialog where the user can see it.
|
2018-07-25 15:18:55 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Presents a window to the user in response to a user interaction.
|
|
|
|
|
* The timestamp should be gathered when the window was requested
|
|
|
|
|
* to be shown (when clicking a link for example), rather than once
|
|
|
|
|
* the window is ready to be shown.
|
|
|
|
|
*/
|
2005-06-20 18:19:34 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_present_with_time (GtkWindow *window,
|
|
|
|
|
guint32 timestamp)
|
2001-02-27 20:40:15 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2001-02-27 20:40:15 +00:00
|
|
|
|
GtkWidget *widget;
|
2018-03-21 10:49:14 +00:00
|
|
|
|
GdkSurface *surface;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
|
|
widget = GTK_WIDGET (window);
|
|
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
|
if (gtk_widget_get_visible (widget))
|
2001-02-27 20:40:15 +00:00
|
|
|
|
{
|
2019-05-20 00:38:08 +00:00
|
|
|
|
surface = priv->surface;
|
2010-08-15 14:49:55 +00:00
|
|
|
|
|
2018-03-21 10:49:14 +00:00
|
|
|
|
g_assert (surface != NULL);
|
2010-08-15 14:49:55 +00:00
|
|
|
|
|
2005-07-11 18:28:23 +00:00
|
|
|
|
/* Translate a timestamp of GDK_CURRENT_TIME appropriately */
|
|
|
|
|
if (timestamp == GDK_CURRENT_TIME)
|
|
|
|
|
{
|
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
2019-02-26 19:07:19 +00:00
|
|
|
|
if (GDK_IS_X11_SURFACE (surface))
|
2011-02-10 18:44:45 +00:00
|
|
|
|
{
|
|
|
|
|
GdkDisplay *display;
|
2005-07-11 18:28:23 +00:00
|
|
|
|
|
2013-07-05 18:24:38 +00:00
|
|
|
|
display = gtk_widget_get_display (widget);
|
2011-02-10 18:44:45 +00:00
|
|
|
|
timestamp = gdk_x11_display_get_user_time (display);
|
|
|
|
|
}
|
|
|
|
|
else
|
2005-07-11 18:28:23 +00:00
|
|
|
|
#endif
|
2011-02-10 18:44:45 +00:00
|
|
|
|
timestamp = gtk_get_current_event_time ();
|
2005-07-11 18:28:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_focus (GDK_TOPLEVEL (surface), timestamp);
|
2001-02-27 20:40:15 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2011-04-12 17:03:38 +00:00
|
|
|
|
priv->initial_timestamp = timestamp;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
gtk_widget_show (widget);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2019-11-16 19:50:57 +00:00
|
|
|
|
* gtk_window_minimize:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2001-02-27 20:40:15 +00:00
|
|
|
|
*
|
2019-11-16 19:50:57 +00:00
|
|
|
|
* Asks to minimize the specified @window.
|
|
|
|
|
*
|
|
|
|
|
* Note that you shouldn’t assume the window is definitely minimized
|
|
|
|
|
* afterward, because the windowing system might not support this
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* functionality; other entities (e.g. the user or the window manager
|
2019-11-16 19:50:57 +00:00
|
|
|
|
* could unminimize it again, or there may not be a window manager in
|
|
|
|
|
* which case minimization isn’t possible, etc.
|
2001-02-27 20:40:15 +00:00
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* It’s permitted to call this function before showing a window,
|
2019-11-16 19:50:57 +00:00
|
|
|
|
* in which case the window will be minimized before it ever appears
|
2001-02-27 20:40:15 +00:00
|
|
|
|
* onscreen.
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* You can track result of this operation via the
|
|
|
|
|
* [property@Gdk.Toplevel:state] property.
|
2017-12-31 13:39:37 +00:00
|
|
|
|
*/
|
2001-02-27 20:40:15 +00:00
|
|
|
|
void
|
2019-11-16 19:50:57 +00:00
|
|
|
|
gtk_window_minimize (GtkWindow *window)
|
2001-02-27 20:40:15 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2015-07-23 21:53:13 +00:00
|
|
|
|
|
2001-02-27 20:40:15 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2019-11-16 19:50:57 +00:00
|
|
|
|
priv->minimize_initially = TRUE;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
|
2019-05-20 00:38:08 +00:00
|
|
|
|
if (priv->surface)
|
2020-02-29 11:53:24 +00:00
|
|
|
|
gdk_toplevel_minimize (GDK_TOPLEVEL (priv->surface));
|
2001-02-27 20:40:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2019-11-16 19:50:57 +00:00
|
|
|
|
* gtk_window_unminimize:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2001-02-27 20:40:15 +00:00
|
|
|
|
*
|
2019-11-16 19:50:57 +00:00
|
|
|
|
* Asks to unminimize the specified @window.
|
2001-02-27 20:40:15 +00:00
|
|
|
|
*
|
2019-11-16 19:50:57 +00:00
|
|
|
|
* Note that you shouldn’t assume the window is definitely unminimized
|
|
|
|
|
* afterward, because the windowing system might not support this
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* functionality; other entities (e.g. the user or the window manager
|
2019-11-16 19:50:57 +00:00
|
|
|
|
* could minimize it again, or there may not be a window manager in
|
|
|
|
|
* which case minimization isn’t possible, etc.
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* You can track result of this operation via the
|
|
|
|
|
* [property@Gdk.Toplevel:state] property.
|
2019-11-16 19:50:57 +00:00
|
|
|
|
*/
|
2001-02-27 20:40:15 +00:00
|
|
|
|
void
|
2019-11-16 19:50:57 +00:00
|
|
|
|
gtk_window_unminimize (GtkWindow *window)
|
2001-02-27 20:40:15 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2015-07-23 21:53:13 +00:00
|
|
|
|
|
2001-02-27 20:40:15 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2019-11-16 19:50:57 +00:00
|
|
|
|
priv->minimize_initially = FALSE;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
|
2020-12-16 10:53:19 +00:00
|
|
|
|
gtk_window_update_toplevel (window,
|
|
|
|
|
gtk_window_compute_base_layout (window));
|
2001-02-27 20:40:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_window_maximize:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2001-02-27 20:40:15 +00:00
|
|
|
|
*
|
2020-12-08 23:49:45 +00:00
|
|
|
|
* Asks to maximize @window, so that it fills the screen.
|
2001-02-27 20:40:15 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Note that you shouldn’t assume the window is definitely maximized
|
|
|
|
|
* afterward, because other entities (e.g. the user or window manager
|
|
|
|
|
* could unmaximize it again, and not all window managers support
|
|
|
|
|
* maximization.
|
2020-12-08 23:49:45 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* It’s permitted to call this function before showing a window,
|
|
|
|
|
* in which case the window will be maximized when it appears onscreen
|
|
|
|
|
* initially.
|
2001-02-27 20:40:15 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* You can track the result of this operation via the
|
|
|
|
|
* [property@Gdk.Toplevel:state] property, or by listening to
|
|
|
|
|
* notifications on the [property@Gtk.Window:maximized]
|
2019-11-16 19:50:57 +00:00
|
|
|
|
* property.
|
|
|
|
|
*/
|
2001-02-27 20:40:15 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_maximize (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2015-07-23 21:53:13 +00:00
|
|
|
|
|
2001-02-27 20:40:15 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2020-12-16 09:10:00 +00:00
|
|
|
|
if (_gtk_widget_get_mapped (GTK_WIDGET (window)))
|
2020-12-05 11:11:25 +00:00
|
|
|
|
{
|
2020-12-16 10:53:19 +00:00
|
|
|
|
GdkToplevelLayout *layout;
|
|
|
|
|
|
|
|
|
|
layout = gtk_window_compute_base_layout (window);
|
|
|
|
|
gdk_toplevel_layout_set_maximized (layout, TRUE);
|
|
|
|
|
gtk_window_update_toplevel (window, layout);
|
2020-12-05 11:11:25 +00:00
|
|
|
|
}
|
2020-12-16 10:53:19 +00:00
|
|
|
|
else if (!priv->maximized)
|
2020-12-05 11:11:25 +00:00
|
|
|
|
{
|
2020-12-16 10:53:19 +00:00
|
|
|
|
priv->maximized = TRUE;
|
2020-12-05 11:11:25 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_MAXIMIZED]);
|
|
|
|
|
}
|
2001-02-27 20:40:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_window_unmaximize:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2001-02-27 20:40:15 +00:00
|
|
|
|
*
|
2020-12-08 23:49:45 +00:00
|
|
|
|
* Asks to unmaximize @window.
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Note that you shouldn’t assume the window is definitely unmaximized
|
|
|
|
|
* afterward, because other entities (e.g. the user or window manager
|
|
|
|
|
* maximize it again, and not all window managers honor requests to
|
|
|
|
|
* unmaximize.
|
2001-02-27 20:40:15 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* You can track the result of this operation via the
|
|
|
|
|
* [property@Gdk.Toplevel:state] property, or by listening to
|
|
|
|
|
* notifications on the [property@Gtk.Window:maximized] property.
|
2019-11-16 19:50:57 +00:00
|
|
|
|
*/
|
2001-02-27 20:40:15 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_unmaximize (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2015-07-23 21:53:13 +00:00
|
|
|
|
|
2001-02-27 20:40:15 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2020-12-16 10:53:19 +00:00
|
|
|
|
if (_gtk_widget_get_mapped (GTK_WIDGET (window)))
|
|
|
|
|
{
|
|
|
|
|
GdkToplevelLayout *layout;
|
2001-02-27 20:40:15 +00:00
|
|
|
|
|
2020-12-16 10:53:19 +00:00
|
|
|
|
layout = gtk_window_compute_base_layout (window);
|
|
|
|
|
gdk_toplevel_layout_set_maximized (layout, FALSE);
|
|
|
|
|
gtk_window_update_toplevel (window, layout);
|
|
|
|
|
}
|
|
|
|
|
else if (priv->maximized)
|
|
|
|
|
{
|
|
|
|
|
priv->maximized = FALSE;
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_MAXIMIZED]);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-12-05 11:11:25 +00:00
|
|
|
|
|
2020-12-16 10:53:19 +00:00
|
|
|
|
static void
|
|
|
|
|
unset_fullscreen_monitor (GtkWindow *window)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
if (priv->initial_fullscreen_monitor)
|
|
|
|
|
{
|
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->initial_fullscreen_monitor, unset_fullscreen_monitor, window);
|
|
|
|
|
g_object_unref (priv->initial_fullscreen_monitor);
|
|
|
|
|
priv->initial_fullscreen_monitor = NULL;
|
|
|
|
|
}
|
2001-02-27 20:40:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-09-25 19:16:46 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_fullscreen:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2002-09-25 19:16:46 +00:00
|
|
|
|
*
|
2020-12-08 23:49:45 +00:00
|
|
|
|
* Asks to place @window in the fullscreen state.
|
2002-09-25 19:16:46 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Note that you shouldn’t assume the window is definitely fullscreen
|
|
|
|
|
* afterward, because other entities (e.g. the user or window manager
|
|
|
|
|
* unfullscreen it again, and not all window managers honor requests
|
|
|
|
|
* to fullscreen windows.
|
2020-12-08 23:49:45 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* You can track the result of this operation via the
|
|
|
|
|
* [property@Gdk.Toplevel:state] property, or by listening to
|
|
|
|
|
* notifications of the [property@Gtk.Window:fullscreened] property.
|
2020-12-08 23:49:45 +00:00
|
|
|
|
*/
|
2002-09-25 19:16:46 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_fullscreen (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
2002-09-25 19:16:46 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2020-12-16 10:53:19 +00:00
|
|
|
|
unset_fullscreen_monitor (window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
2020-12-16 09:10:00 +00:00
|
|
|
|
if (_gtk_widget_get_mapped (GTK_WIDGET (window)))
|
2020-12-16 10:53:19 +00:00
|
|
|
|
{
|
|
|
|
|
GdkToplevelLayout *layout;
|
2017-11-01 15:52:56 +00:00
|
|
|
|
|
2020-12-16 10:53:19 +00:00
|
|
|
|
layout = gtk_window_compute_base_layout (window);
|
|
|
|
|
gdk_toplevel_layout_set_fullscreen (layout, TRUE, NULL);
|
|
|
|
|
gtk_window_update_toplevel (window, layout);
|
|
|
|
|
}
|
|
|
|
|
else if (!priv->fullscreen)
|
2017-11-01 15:52:56 +00:00
|
|
|
|
{
|
2020-12-16 10:53:19 +00:00
|
|
|
|
priv->fullscreen = TRUE;
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_FULLSCREENED]);
|
2017-11-01 15:52:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-13 16:30:42 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_fullscreen_on_monitor:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2015-07-13 16:30:42 +00:00
|
|
|
|
* @monitor: which monitor to go fullscreen on
|
|
|
|
|
*
|
2020-12-08 23:49:45 +00:00
|
|
|
|
* Asks to place @window in the fullscreen state on the given @monitor.
|
2015-07-13 16:30:42 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Note that you shouldn't assume the window is definitely fullscreen
|
2020-12-08 23:49:45 +00:00
|
|
|
|
* afterward, or that the windowing system allows fullscreen windows on
|
|
|
|
|
* any given monitor.
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* You can track the result of this operation via the
|
|
|
|
|
* [property@Gdk.Toplevel:state] property, or by listening to
|
|
|
|
|
* notifications of the [property@Gtk.Window:fullscreened] property.
|
2015-07-13 16:30:42 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
2017-11-01 15:52:56 +00:00
|
|
|
|
gtk_window_fullscreen_on_monitor (GtkWindow *window,
|
|
|
|
|
GdkMonitor *monitor)
|
2015-07-13 16:30:42 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2016-04-11 03:01:10 +00:00
|
|
|
|
|
2015-07-13 16:30:42 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
2017-11-01 15:52:56 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_MONITOR (monitor));
|
|
|
|
|
g_return_if_fail (gdk_monitor_is_valid (monitor));
|
2016-04-11 03:01:10 +00:00
|
|
|
|
|
2017-11-01 15:52:56 +00:00
|
|
|
|
gtk_window_set_display (window, gdk_monitor_get_display (monitor));
|
2015-07-13 16:30:42 +00:00
|
|
|
|
|
2017-11-01 15:52:56 +00:00
|
|
|
|
unset_fullscreen_monitor (window);
|
2015-07-13 16:30:42 +00:00
|
|
|
|
priv->initial_fullscreen_monitor = monitor;
|
2017-11-01 15:52:56 +00:00
|
|
|
|
g_signal_connect_swapped (priv->initial_fullscreen_monitor, "invalidate",
|
|
|
|
|
G_CALLBACK (unset_fullscreen_monitor), window);
|
|
|
|
|
g_object_ref (priv->initial_fullscreen_monitor);
|
|
|
|
|
|
2020-12-16 10:53:19 +00:00
|
|
|
|
if (_gtk_widget_get_mapped (GTK_WIDGET (window)))
|
|
|
|
|
{
|
|
|
|
|
GdkToplevelLayout *layout;
|
2015-07-13 16:30:42 +00:00
|
|
|
|
|
2020-12-16 10:53:19 +00:00
|
|
|
|
layout = gtk_window_compute_base_layout (window);
|
|
|
|
|
gdk_toplevel_layout_set_fullscreen (layout, TRUE, monitor);
|
|
|
|
|
gtk_window_update_toplevel (window, layout);
|
|
|
|
|
}
|
|
|
|
|
else if (!priv->fullscreen)
|
|
|
|
|
{
|
|
|
|
|
priv->fullscreen = TRUE;
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_FULLSCREENED]);
|
|
|
|
|
}
|
2015-07-13 16:30:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-09-25 19:16:46 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_unfullscreen:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2002-09-25 19:16:46 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Asks to remove the fullscreen state for @window, and return to
|
|
|
|
|
* its previous state.
|
2002-09-25 19:16:46 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Note that you shouldn’t assume the window is definitely not
|
|
|
|
|
* fullscreen afterward, because other entities (e.g. the user or
|
|
|
|
|
* window manager could fullscreen it again, and not all window
|
|
|
|
|
* managers honor requests to unfullscreen windows; normally the
|
|
|
|
|
* window will end up restored to its normal state. Just don’t
|
2020-12-08 23:49:45 +00:00
|
|
|
|
* write code that crashes if not.
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* You can track the result of this operation via the
|
|
|
|
|
* [property@Gdk.Toplevel:state] property, or by listening to
|
|
|
|
|
* notifications of the [property@Gtk.Window:fullscreened] property.
|
2020-12-08 23:49:45 +00:00
|
|
|
|
*/
|
2002-09-25 19:16:46 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_unfullscreen (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
2002-09-25 19:16:46 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2017-11-01 15:52:56 +00:00
|
|
|
|
unset_fullscreen_monitor (window);
|
2020-12-05 11:22:25 +00:00
|
|
|
|
|
2020-12-16 09:10:00 +00:00
|
|
|
|
if (_gtk_widget_get_mapped (GTK_WIDGET (window)))
|
2020-12-16 10:53:19 +00:00
|
|
|
|
{
|
|
|
|
|
GdkToplevelLayout *layout;
|
|
|
|
|
|
|
|
|
|
layout = gtk_window_compute_base_layout (window);
|
|
|
|
|
gdk_toplevel_layout_set_fullscreen (layout, FALSE, NULL);
|
|
|
|
|
gtk_window_update_toplevel (window, layout);
|
|
|
|
|
}
|
|
|
|
|
else if (priv->fullscreen)
|
|
|
|
|
{
|
|
|
|
|
priv->fullscreen = FALSE;
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_FULLSCREENED]);
|
|
|
|
|
}
|
2002-09-25 19:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-03-29 23:02:30 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_resizable: (attributes org.gtk.Method.set_property=resizable)
|
|
|
|
|
* @window: a `GtkWindow`
|
2001-06-25 23:48:51 +00:00
|
|
|
|
* @resizable: %TRUE if the user can resize this window
|
2001-03-29 23:02:30 +00:00
|
|
|
|
*
|
2020-12-08 23:49:45 +00:00
|
|
|
|
* Sets whether the user can resize a window.
|
|
|
|
|
*
|
|
|
|
|
* Windows are user resizable by default.
|
2001-03-29 23:02:30 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2001-06-25 23:48:51 +00:00
|
|
|
|
gtk_window_set_resizable (GtkWindow *window,
|
|
|
|
|
gboolean resizable)
|
2001-03-29 23:02:30 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
2001-03-29 23:02:30 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2010-10-11 21:23:01 +00:00
|
|
|
|
resizable = (resizable != FALSE);
|
2010-07-01 03:17:15 +00:00
|
|
|
|
|
2010-10-11 21:23:01 +00:00
|
|
|
|
if (priv->resizable != resizable)
|
|
|
|
|
{
|
2012-05-26 20:12:59 +00:00
|
|
|
|
priv->resizable = resizable;
|
2010-07-01 03:17:15 +00:00
|
|
|
|
|
2020-04-22 17:32:10 +00:00
|
|
|
|
update_window_actions (window);
|
2010-10-08 05:43:03 +00:00
|
|
|
|
|
2019-07-07 05:43:08 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (window));
|
2010-10-11 21:23:01 +00:00
|
|
|
|
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_RESIZABLE]);
|
2010-10-11 21:23:01 +00:00
|
|
|
|
}
|
2001-03-29 23:02:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_resizable: (attributes org.gtk.Method.get_property=resizable)
|
|
|
|
|
* @window: a `GtkWindow`
|
2001-04-01 04:05:42 +00:00
|
|
|
|
*
|
2001-06-25 23:48:51 +00:00
|
|
|
|
* Gets the value set by gtk_window_set_resizable().
|
2001-04-01 04:05:42 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the user can resize the window
|
2001-03-29 23:02:30 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
2001-06-25 23:48:51 +00:00
|
|
|
|
gtk_window_get_resizable (GtkWindow *window)
|
2001-03-29 23:02:30 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2001-03-29 23:02:30 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->resizable;
|
2001-03-29 23:02:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-18 09:12:38 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_display: (attributes org.gtk.Method.set_property=display)
|
|
|
|
|
* @window: a `GtkWindow`
|
|
|
|
|
* @display: a `GdkDisplay`
|
|
|
|
|
*
|
|
|
|
|
* Sets the `GdkDisplay` where the @window is displayed.
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* If the window is already mapped, it will be unmapped,
|
|
|
|
|
* and then remapped on the new display.
|
2010-09-28 17:13:24 +00:00
|
|
|
|
*/
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
|
void
|
2017-10-31 06:41:15 +00:00
|
|
|
|
gtk_window_set_display (GtkWindow *window,
|
|
|
|
|
GdkDisplay *display)
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2002-04-30 23:44:14 +00:00
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
gboolean was_mapped;
|
2011-02-05 03:01:40 +00:00
|
|
|
|
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
2017-10-31 06:41:15 +00:00
|
|
|
|
g_return_if_fail (GDK_IS_DISPLAY (display));
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
|
|
2017-10-31 06:41:15 +00:00
|
|
|
|
if (display == priv->display)
|
2002-04-30 23:44:14 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2015-07-13 16:30:42 +00:00
|
|
|
|
/* reset initial_fullscreen_monitor since they are relative to the screen */
|
2017-11-01 15:52:56 +00:00
|
|
|
|
unset_fullscreen_monitor (window);
|
|
|
|
|
|
2002-04-30 23:44:14 +00:00
|
|
|
|
widget = GTK_WIDGET (window);
|
2002-11-07 17:59:04 +00:00
|
|
|
|
|
2015-09-07 16:23:09 +00:00
|
|
|
|
was_mapped = _gtk_widget_get_mapped (widget);
|
2002-04-30 23:44:14 +00:00
|
|
|
|
|
|
|
|
|
if (was_mapped)
|
|
|
|
|
gtk_widget_unmap (widget);
|
2015-09-06 23:58:03 +00:00
|
|
|
|
if (_gtk_widget_get_realized (widget))
|
2002-04-30 23:44:14 +00:00
|
|
|
|
gtk_widget_unrealize (widget);
|
2011-02-05 03:01:40 +00:00
|
|
|
|
|
2017-11-01 17:16:11 +00:00
|
|
|
|
if (priv->transient_parent && gtk_widget_get_display (GTK_WIDGET (priv->transient_parent)) != display)
|
|
|
|
|
gtk_window_set_transient_for (window, NULL);
|
|
|
|
|
|
2016-10-29 01:25:06 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
2019-05-21 05:14:21 +00:00
|
|
|
|
g_signal_handlers_disconnect_by_func (gtk_settings_get_for_display (priv->display),
|
2017-10-31 06:41:15 +00:00
|
|
|
|
gtk_window_on_theme_variant_changed, window);
|
|
|
|
|
g_signal_connect (gtk_settings_get_for_display (display),
|
|
|
|
|
"notify::gtk-application-prefer-dark-theme",
|
|
|
|
|
G_CALLBACK (gtk_window_on_theme_variant_changed), window);
|
2011-03-25 14:46:41 +00:00
|
|
|
|
#endif
|
2011-02-05 03:01:40 +00:00
|
|
|
|
|
2019-05-01 22:41:20 +00:00
|
|
|
|
gtk_widget_unroot (widget);
|
2019-07-27 05:57:06 +00:00
|
|
|
|
priv->display = display;
|
|
|
|
|
|
2019-05-01 22:41:20 +00:00
|
|
|
|
gtk_widget_root (widget);
|
|
|
|
|
|
2017-10-31 06:41:15 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_DISPLAY]);
|
2002-04-30 23:44:14 +00:00
|
|
|
|
|
|
|
|
|
if (was_mapped)
|
|
|
|
|
gtk_widget_map (widget);
|
2013-06-28 08:39:52 +00:00
|
|
|
|
|
2014-06-26 23:45:55 +00:00
|
|
|
|
check_scale_changed (window);
|
2020-04-21 20:56:42 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_system_setting_changed (GTK_WIDGET (window), GTK_SYSTEM_SETTING_DISPLAY);
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
|
}
|
2002-04-30 23:44:14 +00:00
|
|
|
|
|
2011-03-20 13:37:27 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_set_theme_variant (GtkWindow *window)
|
|
|
|
|
{
|
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2011-03-20 13:37:27 +00:00
|
|
|
|
gboolean dark_theme_requested;
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
g_object_get (gtk_settings_get_for_display (priv->display),
|
2011-03-20 13:37:27 +00:00
|
|
|
|
"gtk-application-prefer-dark-theme", &dark_theme_requested,
|
|
|
|
|
NULL);
|
|
|
|
|
|
2019-05-20 00:38:08 +00:00
|
|
|
|
if (GDK_IS_X11_SURFACE (priv->surface))
|
|
|
|
|
gdk_x11_surface_set_theme_variant (priv->surface,
|
|
|
|
|
dark_theme_requested ? "dark" : NULL);
|
2011-03-20 13:37:27 +00:00
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2012-04-16 15:26:19 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
2011-03-20 13:37:27 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_on_theme_variant_changed (GtkSettings *settings,
|
|
|
|
|
GParamSpec *pspec,
|
|
|
|
|
GtkWindow *window)
|
|
|
|
|
{
|
2020-02-14 20:13:42 +00:00
|
|
|
|
gtk_window_set_theme_variant (window);
|
2011-03-20 13:37:27 +00:00
|
|
|
|
}
|
2012-04-16 15:26:19 +00:00
|
|
|
|
#endif
|
2011-03-20 13:37:27 +00:00
|
|
|
|
|
2003-10-28 15:43:43 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_is_active: (attributes org.gtk.Method.get_property=is-active)
|
|
|
|
|
* @window: a `GtkWindow`
|
|
|
|
|
*
|
2003-10-28 15:43:43 +00:00
|
|
|
|
* Returns whether the window is part of the current active toplevel.
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*
|
|
|
|
|
* The active toplevel is the window receiving keystrokes.
|
|
|
|
|
*
|
2016-10-03 16:30:40 +00:00
|
|
|
|
* The return value is %TRUE if the window is active toplevel itself.
|
2003-10-28 15:43:43 +00:00
|
|
|
|
* You might use this function if you wanted to draw a widget
|
|
|
|
|
* differently in an active window from a widget in an inactive window.
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the window part of the current active window.
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*/
|
2003-10-28 15:43:43 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_window_is_active (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2003-10-28 15:43:43 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->is_active;
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-01-10 04:33:30 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_get_group:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: (allow-none): a `GtkWindow`, or %NULL
|
|
|
|
|
*
|
|
|
|
|
* Returns the group for @window.
|
2006-01-10 04:33:30 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* If the window has no group, then the default group is returned.
|
2006-01-10 04:33:30 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Returns: (transfer none): the `GtkWindowGroup` for a window
|
|
|
|
|
* or the default group
|
2001-06-14 21:44:01 +00:00
|
|
|
|
*/
|
|
|
|
|
GtkWindowGroup *
|
2006-01-10 04:33:30 +00:00
|
|
|
|
gtk_window_get_group (GtkWindow *window)
|
2001-06-14 21:44:01 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
if (window && priv->group)
|
|
|
|
|
return priv->group;
|
2001-06-14 21:44:01 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
static GtkWindowGroup *default_group = NULL;
|
|
|
|
|
|
|
|
|
|
if (!default_group)
|
|
|
|
|
default_group = gtk_window_group_new ();
|
|
|
|
|
|
|
|
|
|
return default_group;
|
|
|
|
|
}
|
|
|
|
|
}
|
fix a typo.
2001-08-07 Havoc Pennington <hp@pobox.com>
* gtk/gtkfilesel.c (open_ref_dir): fix a typo.
* gtk/gtkplug.c (gtk_plug_init): remove setting of auto_shrink;
some fixage is needed here, but nothing simple. Owen understands
it. ;-)
* gtk/gtkwindow.h, gtk/gtkwindow.c: Rework code and API for window
sizing and positioning. Also, fix bug in compute_geometry_hints
(width/height confusion for setting min size).
(gtk_window_move): new function
(gtk_window_resize): new function
(gtk_window_get_size): new function
(gtk_window_get_position): new function
(gtk_window_parse_geometry): new function
* gtk/gtkwidget.c (gtk_widget_set_size_request): new function
(gtk_widget_get_size_request): new function
(gtk_widget_get_usize): delete, that was a short-lived function
;-)
(gtk_widget_set_usize): deprecate
(gtk_widget_set_uposition): deprecate, make it a trivial
gtk_window_move() wrapper
(gtk_widget_class_init): remove x/y/width/height properties,
add width_request height_request
* demos/*: update to avoid deprecated functions
* gtk/gtklayout.c: add x/y child properties
* gtk/gtkfixed.c: add x/y child properties, and get rid of
uses of "gint16"
* tests/testgtk.c (create_window_sizing): lots of tweaks to window
sizing test
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Ensure that
configure events on toplevel windows are always in root window
coordinates, following ICCCM spec that all synthetic events
are in root window coords already, while real events are
in parent window coords. Previously the code assumed that
coords of 0,0 were parent window coords, which was
really broken.
* gtk/gtkcontainer.c (gtk_container_get_focus_chain): fix
warning
* gdk/gdkwindow.h (GdkWindowHints): add GDK_HINT_USER_POS
and GDK_HINT_USER_SIZE so we can set USSize and USPosition
hints in gtk_window_parse_geometry()
* gdk/x11/gdkwindow-x11.c (gdk_window_set_geometry_hints): support
new USER_POS USER_SIZE hints
2001-08-10 03:46:08 +00:00
|
|
|
|
|
2010-05-26 14:49:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_has_group:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2010-05-26 14:49:31 +00:00
|
|
|
|
*
|
|
|
|
|
* Returns whether @window has an explicit window group.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if @window has an explicit window group.
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*/
|
2010-05-26 14:49:31 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_window_has_group (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2010-05-26 14:49:31 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->group != NULL;
|
2010-05-26 14:49:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-06-04 10:18:03 +00:00
|
|
|
|
GtkWindowGroup *
|
|
|
|
|
_gtk_window_get_window_group (GtkWindow *window)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
return priv->group;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2014-06-04 10:18:03 +00:00
|
|
|
|
_gtk_window_set_window_group (GtkWindow *window,
|
|
|
|
|
GtkWindowGroup *group)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
priv->group = group;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-03-04 11:06:30 +00:00
|
|
|
|
static gboolean
|
2018-08-15 04:43:31 +00:00
|
|
|
|
gtk_window_activate_menubar (GtkWidget *widget,
|
|
|
|
|
GVariant *args,
|
|
|
|
|
gpointer unused)
|
2014-03-04 11:06:30 +00:00
|
|
|
|
{
|
2018-08-15 04:43:31 +00:00
|
|
|
|
GtkWindow *window = GTK_WINDOW (widget);
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2018-08-15 04:43:31 +00:00
|
|
|
|
GList *tmp_menubars, *l;
|
|
|
|
|
GPtrArray *menubars;
|
|
|
|
|
GtkWidget *focus;
|
|
|
|
|
GtkWidget *first;
|
2014-03-04 11:06:30 +00:00
|
|
|
|
|
2018-08-15 04:43:31 +00:00
|
|
|
|
focus = gtk_window_get_focus (window);
|
2014-03-04 11:06:30 +00:00
|
|
|
|
|
2018-08-15 04:43:31 +00:00
|
|
|
|
if (priv->title_box != NULL &&
|
|
|
|
|
(focus == NULL || !gtk_widget_is_ancestor (focus, priv->title_box)) &&
|
|
|
|
|
gtk_widget_child_focus (priv->title_box, GTK_DIR_TAB_FORWARD))
|
|
|
|
|
return TRUE;
|
2014-03-04 11:06:30 +00:00
|
|
|
|
|
2018-08-15 04:43:31 +00:00
|
|
|
|
tmp_menubars = gtk_popover_menu_bar_get_viewable_menu_bars (window);
|
|
|
|
|
if (tmp_menubars == NULL)
|
2020-02-18 03:11:56 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
|
2018-08-15 04:43:31 +00:00
|
|
|
|
menubars = g_ptr_array_sized_new (g_list_length (tmp_menubars));;
|
|
|
|
|
for (l = tmp_menubars; l; l = l->next)
|
|
|
|
|
g_ptr_array_add (menubars, l->data);
|
2014-03-04 11:06:30 +00:00
|
|
|
|
|
2018-08-15 04:43:31 +00:00
|
|
|
|
g_list_free (tmp_menubars);
|
2014-03-04 11:06:30 +00:00
|
|
|
|
|
2018-08-15 04:43:31 +00:00
|
|
|
|
gtk_widget_focus_sort (GTK_WIDGET (window), GTK_DIR_TAB_FORWARD, menubars);
|
2020-03-19 22:03:16 +00:00
|
|
|
|
|
2018-08-15 04:43:31 +00:00
|
|
|
|
first = g_ptr_array_index (menubars, 0);
|
|
|
|
|
gtk_popover_menu_bar_select_first (GTK_POPOVER_MENU_BAR (first));
|
2020-03-19 22:03:16 +00:00
|
|
|
|
|
2018-08-15 04:43:31 +00:00
|
|
|
|
g_ptr_array_free (menubars, TRUE);
|
2020-03-19 22:03:16 +00:00
|
|
|
|
|
2018-08-15 04:43:31 +00:00
|
|
|
|
return TRUE;
|
2020-03-19 22:03:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-02-21 17:14:10 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_window_keys_changed (GtkWindow *window)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-04 15:06:40 +00:00
|
|
|
|
/*
|
2002-06-06 15:38:39 +00:00
|
|
|
|
* _gtk_window_set_is_active:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2002-06-06 15:38:39 +00:00
|
|
|
|
* @is_active: %TRUE if the window is in the currently active toplevel
|
2020-07-30 17:22:26 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Internal function that sets whether the `GtkWindow` is part
|
|
|
|
|
* of the currently active toplevel window (taking into account
|
|
|
|
|
* inter-process embedding.)
|
|
|
|
|
*/
|
2019-05-04 15:06:40 +00:00
|
|
|
|
static void
|
2002-06-06 15:38:39 +00:00
|
|
|
|
_gtk_window_set_is_active (GtkWindow *window,
|
2020-07-30 17:22:26 +00:00
|
|
|
|
gboolean is_active)
|
2002-06-06 15:38:39 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2010-08-17 13:37:57 +00:00
|
|
|
|
|
2019-05-04 15:18:35 +00:00
|
|
|
|
if (priv->is_active == is_active)
|
|
|
|
|
return;
|
2017-02-08 13:05:01 +00:00
|
|
|
|
|
2019-05-04 15:18:35 +00:00
|
|
|
|
priv->is_active = is_active;
|
2002-06-06 15:38:39 +00:00
|
|
|
|
|
2020-07-30 17:22:26 +00:00
|
|
|
|
if (priv->focus_widget)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *focus;
|
|
|
|
|
|
|
|
|
|
focus = g_object_ref (priv->focus_widget);
|
|
|
|
|
|
|
|
|
|
if (is_active)
|
|
|
|
|
synthesize_focus_change_events (window, NULL, focus, GTK_CROSSING_ACTIVE);
|
|
|
|
|
else
|
|
|
|
|
synthesize_focus_change_events (window, focus, NULL, GTK_CROSSING_ACTIVE);
|
|
|
|
|
|
|
|
|
|
g_object_unref (focus);
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-04 15:18:35 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_IS_ACTIVE]);
|
2002-06-06 15:38:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-11-02 05:37:04 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_set_auto_startup_notification:
|
|
|
|
|
* @setting: %TRUE to automatically do startup notification
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Sets whether the window should request startup notification.
|
|
|
|
|
*
|
|
|
|
|
* By default, after showing the first `GtkWindow`, GTK calls
|
|
|
|
|
* [method@Gdk.Display.notify_startup_complete]. Call this function
|
|
|
|
|
* to disable the automatic startup notification. You might do this
|
2020-08-05 01:17:49 +00:00
|
|
|
|
* if your first window is a splash screen, and you want to delay
|
|
|
|
|
* notification until after your real main window has been shown,
|
|
|
|
|
* for example.
|
2002-11-02 05:37:04 +00:00
|
|
|
|
*
|
|
|
|
|
* In that example, you would disable startup notification
|
|
|
|
|
* temporarily, show your splash screen, then re-enable it so that
|
|
|
|
|
* showing the main window would automatically result in notification.
|
2021-02-26 04:24:31 +00:00
|
|
|
|
*/
|
2002-11-02 05:37:04 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_set_auto_startup_notification (gboolean setting)
|
|
|
|
|
{
|
|
|
|
|
disable_startup_notification = !setting;
|
|
|
|
|
}
|
2004-12-12 21:09:13 +00:00
|
|
|
|
|
2010-05-01 03:21:58 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_mnemonics_visible: (attributes org.gtk.MEthod.get_property=mnemonics-visible)
|
|
|
|
|
* @window: a `GtkWindow`
|
2010-02-23 19:03:46 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Gets whether mnemonics are supposed to be visible.
|
2010-02-23 19:03:46 +00:00
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE if mnemonics are supposed to be visible
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* in this window.
|
2010-02-23 19:03:46 +00:00
|
|
|
|
*/
|
2009-12-20 08:04:52 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_window_get_mnemonics_visible (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2009-12-20 08:04:52 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->mnemonics_visible;
|
2009-12-20 08:04:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-02-23 19:03:46 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_set_mnemonics_visible:
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* @window: a `GtkWindow`
|
2010-02-23 19:03:46 +00:00
|
|
|
|
* @setting: the new value
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Sets whether mnemonics are supposed to be visible.
|
2010-02-23 19:03:46 +00:00
|
|
|
|
*/
|
2009-12-20 08:04:52 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_set_mnemonics_visible (GtkWindow *window,
|
|
|
|
|
gboolean setting)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2009-12-20 08:04:52 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
|
|
setting = setting != FALSE;
|
|
|
|
|
|
|
|
|
|
if (priv->mnemonics_visible != setting)
|
|
|
|
|
{
|
|
|
|
|
priv->mnemonics_visible = setting;
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_MNEMONICS_VISIBLE]);
|
2009-12-20 08:04:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-04-02 19:56:31 +00:00
|
|
|
|
if (priv->mnemonics_display_timeout_id)
|
2012-08-20 23:28:25 +00:00
|
|
|
|
{
|
2013-04-02 19:56:31 +00:00
|
|
|
|
g_source_remove (priv->mnemonics_display_timeout_id);
|
|
|
|
|
priv->mnemonics_display_timeout_id = 0;
|
2012-08-20 23:28:25 +00:00
|
|
|
|
}
|
2009-12-20 08:04:52 +00:00
|
|
|
|
}
|
2010-08-29 16:53:39 +00:00
|
|
|
|
|
2012-08-20 23:28:25 +00:00
|
|
|
|
static gboolean
|
2013-04-02 19:56:31 +00:00
|
|
|
|
schedule_mnemonics_visible_cb (gpointer data)
|
2012-08-20 23:28:25 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWindow *window = data;
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2012-08-20 23:28:25 +00:00
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
priv->mnemonics_display_timeout_id = 0;
|
2012-08-20 23:28:25 +00:00
|
|
|
|
|
2013-04-02 19:54:02 +00:00
|
|
|
|
gtk_window_set_mnemonics_visible (window, TRUE);
|
2012-08-20 23:28:25 +00:00
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2013-04-02 19:56:31 +00:00
|
|
|
|
_gtk_window_schedule_mnemonics_visible (GtkWindow *window)
|
2012-08-20 23:28:25 +00:00
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2012-08-20 23:28:25 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
if (priv->mnemonics_display_timeout_id)
|
2012-08-20 23:28:25 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
priv->mnemonics_display_timeout_id =
|
2018-02-02 14:51:47 +00:00
|
|
|
|
g_timeout_add (MNEMONICS_DELAY, schedule_mnemonics_visible_cb, window);
|
2019-02-05 10:26:20 +00:00
|
|
|
|
g_source_set_name_by_id (priv->mnemonics_display_timeout_id, "[gtk] schedule_mnemonics_visible_cb");
|
2012-08-20 23:28:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-08-10 14:00:38 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_focus_visible: (attributes org.gtk.Method.get_property=focus-visible)
|
|
|
|
|
* @window: a `GtkWindow`
|
2011-08-10 14:00:38 +00:00
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Gets whether “focus rectangles” are supposed to be visible.
|
2011-08-10 14:00:38 +00:00
|
|
|
|
*
|
2014-02-07 19:03:49 +00:00
|
|
|
|
* Returns: %TRUE if “focus rectangles” are supposed to be visible
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* in this window.
|
2011-08-10 14:00:38 +00:00
|
|
|
|
*/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_window_get_focus_visible (GtkWindow *window)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2011-08-10 14:00:38 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
return priv->focus_visible;
|
2011-08-10 14:00:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-04-21 22:14:40 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
unset_focus_visible (gpointer data)
|
|
|
|
|
{
|
|
|
|
|
GtkWindow *window = data;
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
|
|
|
|
priv->focus_visible_timeout = 0;
|
|
|
|
|
|
|
|
|
|
gtk_window_set_focus_visible (window, FALSE);
|
|
|
|
|
|
|
|
|
|
return G_SOURCE_REMOVE;
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-10 14:00:38 +00:00
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_focus_visible: (attributes org.gtk.MEthod.set_property=focus-visible)
|
|
|
|
|
* @window: a `GtkWindow`
|
2011-08-10 14:00:38 +00:00
|
|
|
|
* @setting: the new value
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Sets whether “focus rectangles” are supposed to be visible.
|
2011-08-10 14:00:38 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_window_set_focus_visible (GtkWindow *window,
|
|
|
|
|
gboolean setting)
|
|
|
|
|
{
|
2020-04-21 22:14:40 +00:00
|
|
|
|
gboolean changed;
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2011-08-10 14:00:38 +00:00
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2020-04-21 22:14:40 +00:00
|
|
|
|
changed = priv->focus_visible != setting;
|
2011-08-10 14:00:38 +00:00
|
|
|
|
|
2020-04-21 22:14:40 +00:00
|
|
|
|
priv->focus_visible = setting;
|
|
|
|
|
|
|
|
|
|
if (priv->focus_visible_timeout)
|
|
|
|
|
{
|
|
|
|
|
g_source_remove (priv->focus_visible_timeout);
|
|
|
|
|
priv->focus_visible_timeout = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (priv->focus_visible)
|
2020-05-05 14:37:10 +00:00
|
|
|
|
priv->focus_visible_timeout = g_timeout_add_seconds (VISIBLE_FOCUS_DURATION, unset_focus_visible, window);
|
2020-04-21 22:14:40 +00:00
|
|
|
|
|
|
|
|
|
if (changed)
|
2011-08-10 14:00:38 +00:00
|
|
|
|
{
|
2020-04-21 22:14:40 +00:00
|
|
|
|
if (priv->focus_widget)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
|
|
for (widget = priv->focus_widget; widget; widget = gtk_widget_get_parent (widget))
|
|
|
|
|
{
|
|
|
|
|
if (priv->focus_visible)
|
|
|
|
|
gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_FOCUS_VISIBLE, FALSE);
|
|
|
|
|
else
|
|
|
|
|
gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_FOCUS_VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-09-05 05:27:52 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_FOCUS_VISIBLE]);
|
2011-08-10 14:00:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-10-28 22:45:38 +00:00
|
|
|
|
static void
|
2012-01-05 17:21:03 +00:00
|
|
|
|
ensure_state_flag_backdrop (GtkWidget *widget)
|
2011-10-28 22:45:38 +00:00
|
|
|
|
{
|
2019-05-20 00:38:08 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (GTK_WINDOW (widget));
|
2018-03-21 10:49:14 +00:00
|
|
|
|
gboolean surface_focused = TRUE;
|
2011-10-28 22:45:38 +00:00
|
|
|
|
|
2020-09-10 04:39:03 +00:00
|
|
|
|
surface_focused = gdk_toplevel_get_state (GDK_TOPLEVEL (priv->surface)) & GDK_TOPLEVEL_STATE_FOCUSED;
|
2011-10-28 22:45:38 +00:00
|
|
|
|
|
2018-03-21 10:49:14 +00:00
|
|
|
|
if (!surface_focused)
|
2012-01-05 17:21:03 +00:00
|
|
|
|
gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_BACKDROP, FALSE);
|
2011-10-28 22:45:38 +00:00
|
|
|
|
else
|
2012-01-05 17:21:03 +00:00
|
|
|
|
gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_BACKDROP);
|
2011-10-28 22:45:38 +00:00
|
|
|
|
}
|
2013-05-15 21:18:05 +00:00
|
|
|
|
|
2014-10-10 03:00:22 +00:00
|
|
|
|
static void set_warn_again (gboolean warn);
|
2019-12-07 16:08:34 +00:00
|
|
|
|
static void gtk_window_set_debugging (GdkDisplay *display,
|
|
|
|
|
gboolean enable,
|
|
|
|
|
gboolean toggle,
|
|
|
|
|
gboolean select,
|
|
|
|
|
gboolean warn);
|
2014-10-10 03:00:22 +00:00
|
|
|
|
|
2014-05-17 01:51:42 +00:00
|
|
|
|
static void
|
|
|
|
|
warn_response (GtkDialog *dialog,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int response)
|
2014-05-17 01:51:42 +00:00
|
|
|
|
{
|
2014-10-10 03:00:22 +00:00
|
|
|
|
GtkWidget *check;
|
|
|
|
|
gboolean remember;
|
2019-12-07 16:08:34 +00:00
|
|
|
|
GtkWidget *inspector_window;
|
|
|
|
|
GdkDisplay *display;
|
|
|
|
|
|
|
|
|
|
inspector_window = GTK_WIDGET (gtk_window_get_transient_for (GTK_WINDOW (dialog)));
|
|
|
|
|
display = gtk_inspector_window_get_inspected_display (GTK_INSPECTOR_WINDOW (inspector_window));
|
2014-10-10 03:00:22 +00:00
|
|
|
|
|
|
|
|
|
check = g_object_get_data (G_OBJECT (dialog), "check");
|
2020-08-30 23:36:27 +00:00
|
|
|
|
remember = gtk_check_button_get_active (GTK_CHECK_BUTTON (check));
|
2014-10-10 03:00:22 +00:00
|
|
|
|
|
2020-05-09 14:26:22 +00:00
|
|
|
|
gtk_window_destroy (GTK_WINDOW (dialog));
|
2014-07-03 14:55:31 +00:00
|
|
|
|
g_object_set_data (G_OBJECT (inspector_window), "warning_dialog", NULL);
|
2015-12-22 02:21:56 +00:00
|
|
|
|
|
2019-12-07 16:08:34 +00:00
|
|
|
|
if (response == GTK_RESPONSE_NO)
|
|
|
|
|
gtk_window_set_debugging (display, FALSE, FALSE, FALSE, FALSE);
|
2014-10-10 03:00:22 +00:00
|
|
|
|
else
|
2019-12-07 16:08:34 +00:00
|
|
|
|
set_warn_again (!remember);
|
2014-05-17 01:51:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2019-12-07 15:34:17 +00:00
|
|
|
|
gtk_window_set_debugging (GdkDisplay *display,
|
|
|
|
|
gboolean enable,
|
|
|
|
|
gboolean toggle,
|
|
|
|
|
gboolean select,
|
|
|
|
|
gboolean warn)
|
2014-05-17 01:51:42 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWidget *dialog = NULL;
|
2014-10-10 03:00:22 +00:00
|
|
|
|
GtkWidget *area;
|
|
|
|
|
GtkWidget *check;
|
2019-12-07 16:08:34 +00:00
|
|
|
|
GtkWidget *inspector_window;
|
|
|
|
|
gboolean was_debugging;
|
2014-05-17 01:51:42 +00:00
|
|
|
|
|
2019-12-07 16:08:34 +00:00
|
|
|
|
was_debugging = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (display), "-gtk-debugging-enabled"));
|
2019-12-07 15:34:17 +00:00
|
|
|
|
|
2019-12-07 16:08:34 +00:00
|
|
|
|
if (toggle)
|
|
|
|
|
enable = !was_debugging;
|
2019-12-07 15:34:17 +00:00
|
|
|
|
|
|
|
|
|
g_object_set_data (G_OBJECT (display), "-gtk-debugging-enabled", GINT_TO_POINTER (enable));
|
|
|
|
|
|
2019-12-07 16:08:34 +00:00
|
|
|
|
if (enable)
|
2014-05-17 01:51:42 +00:00
|
|
|
|
{
|
2019-12-07 15:54:10 +00:00
|
|
|
|
inspector_window = gtk_inspector_window_get (display);
|
2014-05-17 01:51:42 +00:00
|
|
|
|
|
2019-12-07 16:08:34 +00:00
|
|
|
|
gtk_window_present (GTK_WINDOW (inspector_window));
|
|
|
|
|
|
2014-05-17 01:51:42 +00:00
|
|
|
|
if (warn)
|
|
|
|
|
{
|
|
|
|
|
dialog = gtk_message_dialog_new (GTK_WINDOW (inspector_window),
|
|
|
|
|
GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
|
|
|
|
|
GTK_MESSAGE_QUESTION,
|
|
|
|
|
GTK_BUTTONS_NONE,
|
2019-02-21 16:49:03 +00:00
|
|
|
|
_("Do you want to use GTK Inspector?"));
|
2014-05-17 01:51:42 +00:00
|
|
|
|
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
2019-02-21 16:49:03 +00:00
|
|
|
|
_("GTK Inspector is an interactive debugger that lets you explore and "
|
|
|
|
|
"modify the internals of any GTK application. Using it may cause the "
|
2014-05-17 01:51:42 +00:00
|
|
|
|
"application to break or crash."));
|
2014-10-10 03:00:22 +00:00
|
|
|
|
|
|
|
|
|
area = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (dialog));
|
2016-10-03 16:20:03 +00:00
|
|
|
|
check = gtk_check_button_new_with_label (_("Don’t show this message again"));
|
2014-10-10 03:00:22 +00:00
|
|
|
|
gtk_widget_set_margin_start (check, 10);
|
|
|
|
|
gtk_widget_show (check);
|
2020-05-09 12:26:52 +00:00
|
|
|
|
gtk_box_append (GTK_BOX (area), check);
|
2014-10-10 03:00:22 +00:00
|
|
|
|
g_object_set_data (G_OBJECT (dialog), "check", check);
|
2014-05-17 01:51:42 +00:00
|
|
|
|
gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), GTK_RESPONSE_NO);
|
|
|
|
|
gtk_dialog_add_button (GTK_DIALOG (dialog), _("_OK"), GTK_RESPONSE_YES);
|
2019-12-07 16:08:34 +00:00
|
|
|
|
g_signal_connect (dialog, "response", G_CALLBACK (warn_response), inspector_window);
|
2014-07-03 14:55:31 +00:00
|
|
|
|
g_object_set_data (G_OBJECT (inspector_window), "warning_dialog", dialog);
|
2014-07-03 02:52:10 +00:00
|
|
|
|
|
2019-12-07 16:08:34 +00:00
|
|
|
|
gtk_widget_show (dialog);
|
|
|
|
|
}
|
2014-07-06 20:53:37 +00:00
|
|
|
|
|
|
|
|
|
if (select)
|
|
|
|
|
gtk_inspector_window_select_widget_under_pointer (GTK_INSPECTOR_WINDOW (inspector_window));
|
2014-05-17 01:51:42 +00:00
|
|
|
|
}
|
2019-12-07 16:08:34 +00:00
|
|
|
|
else if (was_debugging)
|
2014-07-03 02:52:10 +00:00
|
|
|
|
{
|
2019-12-07 16:08:34 +00:00
|
|
|
|
inspector_window = gtk_inspector_window_get (display);
|
|
|
|
|
|
|
|
|
|
gtk_widget_hide (inspector_window);
|
2014-07-03 02:52:10 +00:00
|
|
|
|
}
|
2014-05-17 01:51:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-13 18:08:15 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_window_set_interactive_debugging:
|
|
|
|
|
* @enable: %TRUE to enable interactive debugging
|
|
|
|
|
*
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* Opens or closes the [interactive debugger](#interactive-debugging).
|
|
|
|
|
*
|
|
|
|
|
* The debugger offers access to the widget hierarchy of the application
|
2014-05-13 18:08:15 +00:00
|
|
|
|
* and to useful debugging tools.
|
|
|
|
|
*/
|
2014-05-10 17:22:17 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_set_interactive_debugging (gboolean enable)
|
2014-05-07 02:20:10 +00:00
|
|
|
|
{
|
2019-12-07 15:34:17 +00:00
|
|
|
|
GdkDisplay *display = gdk_display_get_default ();
|
|
|
|
|
|
|
|
|
|
gtk_window_set_debugging (display, enable, FALSE, FALSE, FALSE);
|
2014-05-10 17:22:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-13 18:16:53 +00:00
|
|
|
|
static gboolean
|
2014-05-17 01:51:42 +00:00
|
|
|
|
inspector_keybinding_enabled (gboolean *warn)
|
2014-05-13 18:16:53 +00:00
|
|
|
|
{
|
|
|
|
|
GSettingsSchema *schema;
|
|
|
|
|
GSettings *settings;
|
|
|
|
|
gboolean enabled;
|
|
|
|
|
|
|
|
|
|
enabled = FALSE;
|
2014-05-17 01:51:42 +00:00
|
|
|
|
*warn = FALSE;
|
2014-05-13 18:16:53 +00:00
|
|
|
|
|
|
|
|
|
schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default (),
|
2019-04-02 19:22:48 +00:00
|
|
|
|
"org.gtk.gtk4.Settings.Debug",
|
2014-09-20 23:52:23 +00:00
|
|
|
|
TRUE);
|
|
|
|
|
|
2014-05-13 18:16:53 +00:00
|
|
|
|
if (schema)
|
|
|
|
|
{
|
|
|
|
|
settings = g_settings_new_full (schema, NULL, NULL);
|
|
|
|
|
enabled = g_settings_get_boolean (settings, "enable-inspector-keybinding");
|
2014-05-17 01:51:42 +00:00
|
|
|
|
*warn = g_settings_get_boolean (settings, "inspector-warning");
|
2014-05-13 18:16:53 +00:00
|
|
|
|
g_object_unref (settings);
|
|
|
|
|
g_settings_schema_unref (schema);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return enabled;
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-10 03:00:22 +00:00
|
|
|
|
static void
|
|
|
|
|
set_warn_again (gboolean warn)
|
|
|
|
|
{
|
|
|
|
|
GSettingsSchema *schema;
|
|
|
|
|
GSettings *settings;
|
|
|
|
|
|
|
|
|
|
schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default (),
|
2019-04-02 19:22:48 +00:00
|
|
|
|
"org.gtk.gtk4.Settings.Debug",
|
2014-10-10 03:00:22 +00:00
|
|
|
|
TRUE);
|
|
|
|
|
|
|
|
|
|
if (schema)
|
|
|
|
|
{
|
|
|
|
|
settings = g_settings_new_full (schema, NULL, NULL);
|
|
|
|
|
g_settings_set_boolean (settings, "inspector-warning", warn);
|
|
|
|
|
g_object_unref (settings);
|
|
|
|
|
g_settings_schema_unref (schema);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-26 13:37:28 +00:00
|
|
|
|
static gboolean
|
2014-07-06 20:53:37 +00:00
|
|
|
|
gtk_window_enable_debugging (GtkWindow *window,
|
|
|
|
|
gboolean toggle)
|
2014-05-10 17:22:17 +00:00
|
|
|
|
{
|
2019-12-07 15:34:17 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2014-05-17 01:51:42 +00:00
|
|
|
|
gboolean warn;
|
|
|
|
|
|
|
|
|
|
if (!inspector_keybinding_enabled (&warn))
|
2014-09-26 13:37:28 +00:00
|
|
|
|
return FALSE;
|
2014-05-13 18:16:53 +00:00
|
|
|
|
|
2019-12-07 15:34:17 +00:00
|
|
|
|
gtk_window_set_debugging (priv->display, TRUE, toggle, !toggle, warn);
|
2014-09-26 13:37:28 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
2014-05-07 02:20:10 +00:00
|
|
|
|
}
|
2014-08-21 15:34:09 +00:00
|
|
|
|
|
2016-07-13 07:22:59 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_WAYLAND
|
|
|
|
|
typedef struct {
|
|
|
|
|
GtkWindow *window;
|
|
|
|
|
GtkWindowHandleExported callback;
|
|
|
|
|
gpointer user_data;
|
2018-03-20 10:40:08 +00:00
|
|
|
|
} WaylandSurfaceHandleExportedData;
|
2016-07-13 07:22:59 +00:00
|
|
|
|
|
|
|
|
|
static void
|
2020-09-19 17:05:57 +00:00
|
|
|
|
wayland_surface_handle_exported (GdkToplevel *toplevel,
|
|
|
|
|
const char *wayland_handle_str,
|
|
|
|
|
gpointer user_data)
|
2016-07-13 07:22:59 +00:00
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
WaylandSurfaceHandleExportedData *data = user_data;
|
2016-07-13 07:22:59 +00:00
|
|
|
|
char *handle_str;
|
|
|
|
|
|
|
|
|
|
handle_str = g_strdup_printf ("wayland:%s", wayland_handle_str);
|
|
|
|
|
data->callback (data->window, handle_str, data->user_data);
|
|
|
|
|
g_free (handle_str);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2016-07-26 19:46:41 +00:00
|
|
|
|
gboolean
|
|
|
|
|
gtk_window_export_handle (GtkWindow *window,
|
|
|
|
|
GtkWindowHandleExported callback,
|
|
|
|
|
gpointer user_data)
|
|
|
|
|
{
|
2019-05-20 00:38:08 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2016-07-26 19:46:41 +00:00
|
|
|
|
|
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
|
|
|
|
if (GDK_IS_X11_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
|
|
|
|
|
{
|
|
|
|
|
char *handle_str;
|
2019-05-20 00:38:08 +00:00
|
|
|
|
guint32 xid = (guint32) gdk_x11_surface_get_xid (priv->surface);
|
2016-07-26 19:46:41 +00:00
|
|
|
|
|
|
|
|
|
handle_str = g_strdup_printf ("x11:%x", xid);
|
|
|
|
|
callback (window, handle_str, user_data);
|
2018-08-13 08:21:42 +00:00
|
|
|
|
g_free (handle_str);
|
2016-07-26 19:46:41 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2016-07-13 07:22:59 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_WAYLAND
|
|
|
|
|
if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
|
|
|
|
|
{
|
2018-03-20 10:40:08 +00:00
|
|
|
|
WaylandSurfaceHandleExportedData *data;
|
2016-07-13 07:22:59 +00:00
|
|
|
|
|
2018-03-20 10:40:08 +00:00
|
|
|
|
data = g_new0 (WaylandSurfaceHandleExportedData, 1);
|
2016-07-13 07:22:59 +00:00
|
|
|
|
data->window = window;
|
|
|
|
|
data->callback = callback;
|
|
|
|
|
data->user_data = user_data;
|
|
|
|
|
|
2020-09-19 17:05:57 +00:00
|
|
|
|
if (!gdk_wayland_toplevel_export_handle (GDK_TOPLEVEL (priv->surface),
|
|
|
|
|
wayland_surface_handle_exported,
|
|
|
|
|
data,
|
|
|
|
|
g_free))
|
2016-07-13 07:22:59 +00:00
|
|
|
|
{
|
|
|
|
|
g_free (data);
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2016-07-26 19:46:41 +00:00
|
|
|
|
|
2019-05-27 16:26:19 +00:00
|
|
|
|
g_warning ("Couldn't export handle for %s surface, unsupported windowing system",
|
|
|
|
|
G_OBJECT_TYPE_NAME (priv->surface));
|
2016-07-26 19:46:41 +00:00
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
gtk_window_unexport_handle (GtkWindow *window)
|
|
|
|
|
{
|
2019-05-20 00:38:08 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2016-07-13 07:22:59 +00:00
|
|
|
|
#ifdef GDK_WINDOWING_WAYLAND
|
|
|
|
|
if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
|
|
|
|
|
{
|
2020-09-19 17:05:57 +00:00
|
|
|
|
gdk_wayland_toplevel_unexport_handle (GDK_TOPLEVEL (priv->surface));
|
2019-05-27 16:26:19 +00:00
|
|
|
|
return;
|
2016-07-13 07:22:59 +00:00
|
|
|
|
}
|
|
|
|
|
#endif
|
2019-05-27 16:26:19 +00:00
|
|
|
|
|
|
|
|
|
g_warning ("Couldn't unexport handle for %s surface, unsupported windowing system",
|
|
|
|
|
G_OBJECT_TYPE_NAME (priv->surface));
|
2016-07-26 19:46:41 +00:00
|
|
|
|
}
|
2016-06-23 16:34:38 +00:00
|
|
|
|
|
2017-03-31 15:31:20 +00:00
|
|
|
|
static GtkPointerFocus *
|
|
|
|
|
gtk_window_lookup_pointer_focus (GtkWindow *window,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkEventSequence *sequence)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2017-03-31 15:31:20 +00:00
|
|
|
|
GList *l;
|
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
for (l = priv->foci; l; l = l->next)
|
2017-03-31 15:31:20 +00:00
|
|
|
|
{
|
|
|
|
|
GtkPointerFocus *focus = l->data;
|
|
|
|
|
|
|
|
|
|
if (focus->device == device && focus->sequence == sequence)
|
|
|
|
|
return focus;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_window_lookup_pointer_focus_widget (GtkWindow *window,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkEventSequence *sequence)
|
|
|
|
|
{
|
|
|
|
|
GtkPointerFocus *focus;
|
|
|
|
|
|
|
|
|
|
focus = gtk_window_lookup_pointer_focus (window, device, sequence);
|
|
|
|
|
return focus ? gtk_pointer_focus_get_target (focus) : NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_window_lookup_effective_pointer_focus_widget (GtkWindow *window,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkEventSequence *sequence)
|
|
|
|
|
{
|
|
|
|
|
GtkPointerFocus *focus;
|
|
|
|
|
|
|
|
|
|
focus = gtk_window_lookup_pointer_focus (window, device, sequence);
|
|
|
|
|
return focus ? gtk_pointer_focus_get_effective_target (focus) : NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-24 23:57:22 +00:00
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_window_lookup_pointer_focus_implicit_grab (GtkWindow *window,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkEventSequence *sequence)
|
|
|
|
|
{
|
|
|
|
|
GtkPointerFocus *focus;
|
|
|
|
|
|
|
|
|
|
focus = gtk_window_lookup_pointer_focus (window, device, sequence);
|
|
|
|
|
return focus ? gtk_pointer_focus_get_implicit_grab (focus) : NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-31 15:31:20 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_update_pointer_focus (GtkWindow *window,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkEventSequence *sequence,
|
|
|
|
|
GtkWidget *target,
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double x,
|
|
|
|
|
double y)
|
2017-03-31 15:31:20 +00:00
|
|
|
|
{
|
2019-07-21 08:52:12 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2017-03-31 15:31:20 +00:00
|
|
|
|
GtkPointerFocus *focus;
|
|
|
|
|
|
|
|
|
|
focus = gtk_window_lookup_pointer_focus (window, device, sequence);
|
|
|
|
|
if (focus)
|
|
|
|
|
{
|
2017-05-25 14:00:40 +00:00
|
|
|
|
gtk_pointer_focus_ref (focus);
|
|
|
|
|
|
2017-03-31 15:31:20 +00:00
|
|
|
|
if (target)
|
|
|
|
|
{
|
|
|
|
|
gtk_pointer_focus_set_target (focus, target);
|
|
|
|
|
gtk_pointer_focus_set_coordinates (focus, x, y);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2019-07-21 08:52:12 +00:00
|
|
|
|
GList *pos;
|
|
|
|
|
|
|
|
|
|
pos = g_list_find (priv->foci, focus);
|
|
|
|
|
if (pos)
|
|
|
|
|
{
|
|
|
|
|
priv->foci = g_list_remove (priv->foci, focus);
|
|
|
|
|
gtk_pointer_focus_unref (focus);
|
|
|
|
|
}
|
2017-03-31 15:31:20 +00:00
|
|
|
|
}
|
2017-05-25 14:00:40 +00:00
|
|
|
|
|
|
|
|
|
gtk_pointer_focus_unref (focus);
|
2017-03-31 15:31:20 +00:00
|
|
|
|
}
|
|
|
|
|
else if (target)
|
|
|
|
|
{
|
|
|
|
|
focus = gtk_pointer_focus_new (window, target, device, sequence, x, y);
|
2019-07-21 08:52:12 +00:00
|
|
|
|
priv->foci = g_list_prepend (priv->foci, focus);
|
2017-03-31 15:31:20 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-31 15:49:21 +00:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
gtk_window_update_pointer_focus_on_state_change (GtkWindow *window,
|
|
|
|
|
GtkWidget *widget)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-01-02 12:52:14 +00:00
|
|
|
|
GList *l = priv->foci;
|
2017-03-31 15:49:21 +00:00
|
|
|
|
|
|
|
|
|
while (l)
|
|
|
|
|
{
|
2020-01-02 12:52:14 +00:00
|
|
|
|
GList *next;
|
|
|
|
|
|
2017-03-31 15:49:21 +00:00
|
|
|
|
GtkPointerFocus *focus = l->data;
|
|
|
|
|
|
2020-01-02 12:52:14 +00:00
|
|
|
|
next = l->next;
|
2017-03-31 15:49:21 +00:00
|
|
|
|
|
2017-05-25 14:00:40 +00:00
|
|
|
|
gtk_pointer_focus_ref (focus);
|
|
|
|
|
|
2018-01-29 11:31:53 +00:00
|
|
|
|
if (focus->grab_widget &&
|
|
|
|
|
(focus->grab_widget == widget ||
|
|
|
|
|
gtk_widget_is_ancestor (focus->grab_widget, widget)))
|
|
|
|
|
gtk_pointer_focus_set_implicit_grab (focus, NULL);
|
|
|
|
|
|
2017-03-31 15:49:21 +00:00
|
|
|
|
if (GTK_WIDGET (focus->toplevel) == widget)
|
|
|
|
|
{
|
|
|
|
|
/* Unmapping the toplevel, remove pointer focus */
|
2020-01-02 12:52:14 +00:00
|
|
|
|
priv->foci = g_list_remove_link (priv->foci, l);
|
2019-02-10 09:28:32 +00:00
|
|
|
|
gtk_pointer_focus_unref (focus);
|
2020-01-02 12:52:14 +00:00
|
|
|
|
g_list_free (l);
|
2017-03-31 15:49:21 +00:00
|
|
|
|
}
|
|
|
|
|
else if (focus->target == widget ||
|
|
|
|
|
gtk_widget_is_ancestor (focus->target, widget))
|
|
|
|
|
{
|
|
|
|
|
gtk_pointer_focus_repick_target (focus);
|
|
|
|
|
}
|
2017-05-25 14:00:40 +00:00
|
|
|
|
|
|
|
|
|
gtk_pointer_focus_unref (focus);
|
2020-01-02 12:52:14 +00:00
|
|
|
|
|
|
|
|
|
l = next;
|
2017-03-31 15:49:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-31 15:55:49 +00:00
|
|
|
|
|
2017-04-01 20:38:02 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_maybe_revoke_implicit_grab (GtkWindow *window,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GtkWidget *grab_widget)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
2020-01-02 12:52:14 +00:00
|
|
|
|
GList *l = priv->foci;
|
2017-04-01 20:38:02 +00:00
|
|
|
|
|
|
|
|
|
while (l)
|
|
|
|
|
{
|
|
|
|
|
GtkPointerFocus *focus = l->data;
|
|
|
|
|
|
2020-01-02 12:52:14 +00:00
|
|
|
|
l = l->next;
|
2017-04-01 20:38:02 +00:00
|
|
|
|
|
|
|
|
|
if (focus->toplevel != window)
|
|
|
|
|
continue;
|
|
|
|
|
|
2020-04-24 21:04:27 +00:00
|
|
|
|
if ((!device || focus->device == device) &&
|
2017-04-01 20:38:02 +00:00
|
|
|
|
focus->target != grab_widget &&
|
|
|
|
|
!gtk_widget_is_ancestor (focus->target, grab_widget))
|
|
|
|
|
gtk_window_set_pointer_focus_grab (window,
|
|
|
|
|
focus->device,
|
|
|
|
|
focus->sequence,
|
|
|
|
|
NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-31 15:55:49 +00:00
|
|
|
|
void
|
|
|
|
|
gtk_window_set_pointer_focus_grab (GtkWindow *window,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkEventSequence *sequence,
|
|
|
|
|
GtkWidget *grab_widget)
|
|
|
|
|
{
|
|
|
|
|
GtkPointerFocus *focus;
|
|
|
|
|
|
|
|
|
|
focus = gtk_window_lookup_pointer_focus (window, device, sequence);
|
2017-04-01 20:41:23 +00:00
|
|
|
|
if (!focus && !grab_widget)
|
|
|
|
|
return;
|
2017-03-31 15:55:49 +00:00
|
|
|
|
g_assert (focus != NULL);
|
|
|
|
|
gtk_pointer_focus_set_implicit_grab (focus, grab_widget);
|
|
|
|
|
}
|
2017-04-04 15:08:48 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
update_cursor (GtkWindow *toplevel,
|
|
|
|
|
GdkDevice *device,
|
2017-05-24 23:45:18 +00:00
|
|
|
|
GtkWidget *grab_widget,
|
2017-04-04 15:08:48 +00:00
|
|
|
|
GtkWidget *target)
|
|
|
|
|
{
|
2020-04-10 18:35:02 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (toplevel);
|
2017-04-04 15:08:48 +00:00
|
|
|
|
GdkCursor *cursor = NULL;
|
2020-09-27 12:57:05 +00:00
|
|
|
|
GtkNative *native;
|
2019-04-26 23:48:13 +00:00
|
|
|
|
GdkSurface *surface;
|
|
|
|
|
|
2020-09-27 12:57:05 +00:00
|
|
|
|
native = gtk_widget_get_native (target);
|
|
|
|
|
surface = gtk_native_get_surface (native);
|
2017-04-04 15:08:48 +00:00
|
|
|
|
|
2020-04-13 02:18:50 +00:00
|
|
|
|
if (grab_widget && !gtk_widget_is_ancestor (target, grab_widget) && target != grab_widget)
|
2017-04-04 15:08:48 +00:00
|
|
|
|
{
|
2017-05-24 23:45:18 +00:00
|
|
|
|
/* Outside the grab widget, cursor stays to whatever the grab
|
|
|
|
|
* widget says.
|
|
|
|
|
*/
|
2020-09-27 12:57:05 +00:00
|
|
|
|
if (gtk_widget_get_native (grab_widget) == native)
|
2019-05-01 00:16:21 +00:00
|
|
|
|
cursor = gtk_widget_get_cursor (grab_widget);
|
|
|
|
|
else
|
|
|
|
|
cursor = NULL;
|
2017-05-24 23:45:18 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Inside the grab widget or in absence of grabs, allow walking
|
|
|
|
|
* up the hierarchy to find out the cursor.
|
|
|
|
|
*/
|
|
|
|
|
while (target)
|
|
|
|
|
{
|
2019-05-04 16:21:33 +00:00
|
|
|
|
/* Don't inherit cursors across surfaces */
|
2020-09-27 12:57:05 +00:00
|
|
|
|
if (native != gtk_widget_get_native (target))
|
2019-05-04 16:21:33 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2020-04-10 18:35:02 +00:00
|
|
|
|
if (target == GTK_WIDGET (toplevel) && priv->resize_cursor != NULL)
|
|
|
|
|
cursor = priv->resize_cursor;
|
|
|
|
|
else
|
|
|
|
|
cursor = gtk_widget_get_cursor (target);
|
2019-01-16 16:37:42 +00:00
|
|
|
|
|
|
|
|
|
if (cursor)
|
|
|
|
|
break;
|
|
|
|
|
|
2020-04-13 02:18:50 +00:00
|
|
|
|
if (grab_widget && target == grab_widget)
|
|
|
|
|
break;
|
|
|
|
|
|
2017-05-24 23:45:18 +00:00
|
|
|
|
target = _gtk_widget_get_parent (target);
|
|
|
|
|
}
|
2017-04-04 15:08:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-04-26 23:48:13 +00:00
|
|
|
|
gdk_surface_set_device_cursor (surface, device, cursor);
|
2017-04-04 15:08:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
gtk_window_maybe_update_cursor (GtkWindow *window,
|
|
|
|
|
GtkWidget *widget,
|
|
|
|
|
GdkDevice *device)
|
|
|
|
|
{
|
2018-06-18 19:50:33 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
GList *l;
|
2017-04-04 15:08:48 +00:00
|
|
|
|
|
2018-06-18 19:50:33 +00:00
|
|
|
|
for (l = priv->foci; l; l = l->next)
|
2017-04-04 15:08:48 +00:00
|
|
|
|
{
|
|
|
|
|
GtkPointerFocus *focus = l->data;
|
2017-05-24 23:45:18 +00:00
|
|
|
|
GtkWidget *grab_widget, *target;
|
|
|
|
|
GtkWindowGroup *group;
|
2017-04-04 15:08:48 +00:00
|
|
|
|
|
|
|
|
|
if (focus->sequence)
|
|
|
|
|
continue;
|
|
|
|
|
if (device && device != focus->device)
|
|
|
|
|
continue;
|
|
|
|
|
|
2017-05-24 23:45:18 +00:00
|
|
|
|
group = gtk_window_get_group (window);
|
2020-02-28 21:27:42 +00:00
|
|
|
|
|
|
|
|
|
grab_widget = gtk_window_group_get_current_grab (group);
|
2017-05-24 23:45:18 +00:00
|
|
|
|
if (!grab_widget)
|
|
|
|
|
grab_widget = gtk_pointer_focus_get_implicit_grab (focus);
|
|
|
|
|
|
|
|
|
|
target = gtk_pointer_focus_get_target (focus);
|
|
|
|
|
|
|
|
|
|
if (widget)
|
|
|
|
|
{
|
|
|
|
|
/* Check whether the changed widget affects the current cursor
|
|
|
|
|
* lookups.
|
|
|
|
|
*/
|
|
|
|
|
if (grab_widget && grab_widget != widget &&
|
|
|
|
|
!gtk_widget_is_ancestor (widget, grab_widget))
|
|
|
|
|
continue;
|
2018-01-02 20:46:19 +00:00
|
|
|
|
if (target != widget &&
|
2017-05-24 23:45:18 +00:00
|
|
|
|
!gtk_widget_is_ancestor (target, widget))
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2017-04-04 15:08:48 +00:00
|
|
|
|
|
2017-05-24 23:45:18 +00:00
|
|
|
|
update_cursor (focus->toplevel, focus->device, grab_widget, target);
|
2017-04-04 15:08:48 +00:00
|
|
|
|
|
|
|
|
|
if (device)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-05-02 15:33:10 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_set_child: (attributes org.gtk.Method.set_property=child)
|
|
|
|
|
* @window: a `GtkWindow`
|
2020-05-02 15:33:10 +00:00
|
|
|
|
* @child: (allow-none): the child widget
|
|
|
|
|
*
|
|
|
|
|
* Sets the child widget of @window.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_window_set_child (GtkWindow *window,
|
|
|
|
|
GtkWidget *child)
|
|
|
|
|
{
|
2020-05-02 19:17:20 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2020-05-02 15:33:10 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
g_return_if_fail (child == NULL || GTK_IS_WIDGET (child));
|
|
|
|
|
|
2020-05-02 19:17:20 +00:00
|
|
|
|
g_clear_pointer (&priv->child, gtk_widget_unparent);
|
|
|
|
|
|
|
|
|
|
if (child)
|
|
|
|
|
{
|
|
|
|
|
priv->child = child;
|
2020-08-01 07:30:48 +00:00
|
|
|
|
gtk_widget_insert_before (child, GTK_WIDGET (window), priv->title_box);
|
2020-05-02 19:17:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-05-02 15:33:10 +00:00
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_CHILD]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-02-26 04:24:31 +00:00
|
|
|
|
* gtk_window_get_child: (attributes org.gtk.Method.get_property=child)
|
|
|
|
|
* @window: a `GtkWindow`
|
2020-05-02 15:33:10 +00:00
|
|
|
|
*
|
|
|
|
|
* Gets the child widget of @window.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (nullable) (transfer none): the child widget of @window
|
|
|
|
|
*/
|
|
|
|
|
GtkWidget *
|
|
|
|
|
gtk_window_get_child (GtkWindow *window)
|
|
|
|
|
{
|
2020-05-02 19:17:20 +00:00
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
|
2020-05-02 15:33:10 +00:00
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
|
|
|
|
|
|
2020-05-02 19:17:20 +00:00
|
|
|
|
return priv->child;
|
2020-05-02 15:33:10 +00:00
|
|
|
|
}
|
2020-05-09 13:30:29 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_window_destroy:
|
|
|
|
|
* @window: The window to destroy
|
|
|
|
|
*
|
|
|
|
|
* Drop the internal reference GTK holds on toplevel windows.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_window_destroy (GtkWindow *window)
|
|
|
|
|
{
|
2020-05-13 09:34:33 +00:00
|
|
|
|
guint i;
|
2020-05-09 19:20:59 +00:00
|
|
|
|
|
2020-05-09 13:30:29 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
2020-05-13 09:34:33 +00:00
|
|
|
|
/* If gtk_window_destroy() has been called before. Can happen
|
|
|
|
|
* when destroying a dialog manually in a ::close handler for example. */
|
|
|
|
|
if (!g_list_store_find (toplevel_list, window, &i))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
g_object_ref (window);
|
2020-10-24 19:23:12 +00:00
|
|
|
|
|
2020-05-09 20:46:40 +00:00
|
|
|
|
gtk_tooltip_unset_surface (GTK_NATIVE (window));
|
|
|
|
|
|
2020-10-24 19:23:12 +00:00
|
|
|
|
gtk_window_hide (GTK_WIDGET (window));
|
|
|
|
|
gtk_accessible_update_state (GTK_ACCESSIBLE (window),
|
|
|
|
|
GTK_ACCESSIBLE_STATE_HIDDEN, TRUE,
|
|
|
|
|
-1);
|
|
|
|
|
|
2020-05-13 09:34:33 +00:00
|
|
|
|
g_list_store_remove (toplevel_list, i);
|
2020-05-09 19:20:59 +00:00
|
|
|
|
|
2020-12-23 01:34:13 +00:00
|
|
|
|
gtk_window_release_application (window);
|
|
|
|
|
|
2020-05-09 19:20:59 +00:00
|
|
|
|
gtk_widget_unrealize (GTK_WIDGET (window));
|
|
|
|
|
|
|
|
|
|
g_object_unref (window);
|
2020-05-09 13:30:29 +00:00
|
|
|
|
}
|
2020-06-24 09:14:52 +00:00
|
|
|
|
|
|
|
|
|
GdkDevice**
|
|
|
|
|
gtk_window_get_foci_on_widget (GtkWindow *window,
|
|
|
|
|
GtkWidget *widget,
|
|
|
|
|
guint *n_devices)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
GPtrArray *array = g_ptr_array_new ();
|
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
|
|
for (l = priv->foci; l; l = l->next)
|
|
|
|
|
{
|
|
|
|
|
GtkPointerFocus *focus = l->data;
|
|
|
|
|
GtkWidget *target;
|
|
|
|
|
|
|
|
|
|
target = gtk_pointer_focus_get_effective_target (focus);
|
|
|
|
|
|
|
|
|
|
if (target == widget || gtk_widget_is_ancestor (target, widget))
|
|
|
|
|
g_ptr_array_add (array, focus->device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (n_devices)
|
|
|
|
|
*n_devices = array->len;
|
|
|
|
|
|
|
|
|
|
return (GdkDevice**) g_ptr_array_free (array, FALSE);
|
|
|
|
|
}
|
2020-06-24 15:19:57 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_grab_notify_foreach (GtkWidget *child,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GtkWidget *new_grab_widget,
|
|
|
|
|
GtkWidget *old_grab_widget,
|
|
|
|
|
gboolean from_grab,
|
|
|
|
|
gboolean was_shadowed,
|
|
|
|
|
gboolean is_shadowed)
|
|
|
|
|
{
|
|
|
|
|
g_object_ref (child);
|
|
|
|
|
|
|
|
|
|
if (is_shadowed)
|
|
|
|
|
{
|
|
|
|
|
if (!was_shadowed &&
|
|
|
|
|
gtk_widget_is_sensitive (child))
|
|
|
|
|
_gtk_widget_synthesize_crossing (child,
|
|
|
|
|
new_grab_widget,
|
|
|
|
|
device,
|
|
|
|
|
GDK_CROSSING_GTK_GRAB);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (was_shadowed &&
|
|
|
|
|
gtk_widget_is_sensitive (child))
|
|
|
|
|
_gtk_widget_synthesize_crossing (old_grab_widget, child,
|
|
|
|
|
device,
|
|
|
|
|
from_grab ? GDK_CROSSING_GTK_GRAB :
|
|
|
|
|
GDK_CROSSING_GTK_UNGRAB);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_gtk_widget_grab_notify (child, was_shadowed);
|
|
|
|
|
|
|
|
|
|
g_object_unref (child);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_window_propagate_grab_notify (GtkWindow *window,
|
|
|
|
|
GtkWidget *target,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GtkWidget *old_grab_widget,
|
|
|
|
|
GtkWidget *new_grab_widget,
|
|
|
|
|
gboolean from_grab)
|
|
|
|
|
{
|
|
|
|
|
GList *l, *widgets = NULL;
|
|
|
|
|
gboolean was_grabbed = FALSE, is_grabbed = FALSE;
|
|
|
|
|
|
|
|
|
|
while (target)
|
|
|
|
|
{
|
|
|
|
|
widgets = g_list_prepend (widgets, g_object_ref (target));
|
|
|
|
|
target = gtk_widget_get_parent (target);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
widgets = g_list_reverse (widgets);
|
|
|
|
|
|
|
|
|
|
for (l = widgets; l; l = l->next)
|
|
|
|
|
{
|
|
|
|
|
gboolean was_shadowed, is_shadowed;
|
|
|
|
|
|
|
|
|
|
was_grabbed |= (l->data == old_grab_widget);
|
|
|
|
|
is_grabbed |= (l->data == new_grab_widget);
|
|
|
|
|
|
|
|
|
|
was_shadowed = old_grab_widget && !was_grabbed;
|
|
|
|
|
is_shadowed = new_grab_widget && is_grabbed;
|
|
|
|
|
|
|
|
|
|
if (was_shadowed == is_shadowed)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
gtk_grab_notify_foreach (l->data,
|
|
|
|
|
device,
|
|
|
|
|
old_grab_widget,
|
|
|
|
|
new_grab_widget,
|
|
|
|
|
from_grab,
|
|
|
|
|
was_shadowed,
|
|
|
|
|
is_shadowed);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_list_free_full (widgets, g_object_unref);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
gtk_window_grab_notify (GtkWindow *window,
|
|
|
|
|
GtkWidget *old_grab_widget,
|
|
|
|
|
GtkWidget *new_grab_widget,
|
|
|
|
|
gboolean from_grab)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
|
|
for (l = priv->foci; l; l = l->next)
|
|
|
|
|
{
|
|
|
|
|
GtkPointerFocus *focus = l->data;
|
|
|
|
|
|
|
|
|
|
gtk_window_propagate_grab_notify (window,
|
|
|
|
|
gtk_pointer_focus_get_effective_target (focus),
|
|
|
|
|
focus->device,
|
|
|
|
|
old_grab_widget,
|
|
|
|
|
new_grab_widget,
|
|
|
|
|
from_grab);
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-03-14 23:37:11 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_window_set_handle_menubar_accel: (attributes org.gtk.Method.set_property=handle-menubar-accel)
|
|
|
|
|
* @window: a #GtkWindow
|
|
|
|
|
* @handle_menubar_accel: %TRUE to make @window handle F10
|
|
|
|
|
*
|
|
|
|
|
* Sets whether this window should react to F10 key presses
|
|
|
|
|
* by activating a menubar it contains.
|
|
|
|
|
*
|
|
|
|
|
* Since: 4.2
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_window_set_handle_menubar_accel (GtkWindow *window,
|
|
|
|
|
gboolean handle_menubar_accel)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
GtkPropagationPhase phase;
|
|
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WINDOW (window));
|
|
|
|
|
|
|
|
|
|
phase = handle_menubar_accel ? GTK_PHASE_CAPTURE : GTK_PHASE_NONE;
|
|
|
|
|
|
|
|
|
|
if (gtk_event_controller_get_propagation_phase (priv->menubar_controller) == phase)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
gtk_event_controller_set_propagation_phase (priv->menubar_controller, phase);
|
|
|
|
|
|
|
|
|
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_HANDLE_MENUBAR_ACCEL]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_window_get_handle_menubar_accel: (attributes org.gtk.Method.get_property=handle-menubar-accel)
|
|
|
|
|
* @window: a #GtkWindow
|
|
|
|
|
*
|
|
|
|
|
* Returns whether this window reacts to F10 key presses by
|
|
|
|
|
* activating a menubar it contains.
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE if the window handles F10
|
|
|
|
|
*
|
|
|
|
|
* Since: 4.2
|
|
|
|
|
*/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_window_get_handle_menubar_accel (GtkWindow *window)
|
|
|
|
|
{
|
|
|
|
|
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
|
|
|
|
GtkPropagationPhase phase;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WINDOW (window), TRUE);
|
|
|
|
|
|
|
|
|
|
phase = gtk_event_controller_get_propagation_phase (priv->menubar_controller);
|
|
|
|
|
|
|
|
|
|
return phase == GTK_PHASE_CAPTURE;
|
|
|
|
|
}
|