aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDavid Bordoley <bordoley@msu.edu>2003-05-01 00:58:56 +0800
committerDave Bordoley <Bordoley@src.gnome.org>2003-05-01 00:58:56 +0800
commita2cc71e51c55bd11d65facb13c8915f774ef3bac (patch)
treedcaca2998a73778b434bc2102894fe623d496cb6 /lib
parent6a6479ca2b2c1fd5aa78c860299d1a96ef51f199 (diff)
downloadgsoc2013-epiphany-a2cc71e51c55bd11d65facb13c8915f774ef3bac.tar
gsoc2013-epiphany-a2cc71e51c55bd11d65facb13c8915f774ef3bac.tar.gz
gsoc2013-epiphany-a2cc71e51c55bd11d65facb13c8915f774ef3bac.tar.bz2
gsoc2013-epiphany-a2cc71e51c55bd11d65facb13c8915f774ef3bac.tar.lz
gsoc2013-epiphany-a2cc71e51c55bd11d65facb13c8915f774ef3bac.tar.xz
gsoc2013-epiphany-a2cc71e51c55bd11d65facb13c8915f774ef3bac.tar.zst
gsoc2013-epiphany-a2cc71e51c55bd11d65facb13c8915f774ef3bac.zip
Don't set/save window position if it is maximized.
2003-04-30 David Bordoley <bordoley@msu.edu> * lib/ephy-state.c: (ephy_state_window_set_position), (ephy_state_window_save_position): Don't set/save window position if it is maximized. * src/ephy-history-window.c: (ephy_history_window_construct): * src/bookmarks/ephy-bookmarks-editor.c: (ephy_bookmarks_editor_construct): Don't set the shadow_type to GTK_SHADOW_IN the ScrolledWindows. It breaks some fitts law considerations, and really amounts to just visual noise.
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-state.c64
1 files changed, 41 insertions, 23 deletions
diff --git a/lib/ephy-state.c b/lib/ephy-state.c
index 746554562..55a109d1a 100644
--- a/lib/ephy-state.c
+++ b/lib/ephy-state.c
@@ -177,28 +177,36 @@ ephy_state_window_set_position (GtkWidget *window, EphyNode *node)
GdkScreen *screen;
int x, y;
int screen_width, screen_height;
+ gboolean maximize;
g_return_if_fail (GTK_IS_WINDOW (window));
/* Setting the default size doesn't work when the window is already showing. */
g_return_if_fail (!GTK_WIDGET_VISIBLE (window));
- x = ephy_node_get_property_int (node, EPHY_NODE_STATE_PROP_POSITION_X);
- y = ephy_node_get_property_int (node, EPHY_NODE_STATE_PROP_POSITION_Y);
+ maximize = ephy_node_get_property_boolean (node, EPHY_NODE_STATE_PROP_MAXIMIZE);
- screen = gtk_window_get_screen (GTK_WINDOW (window));
- screen_width = gdk_screen_get_width (screen);
- screen_height = gdk_screen_get_height (screen);
+ /* Don't set the position of the window if it is maximized */
- if ((x >= screen_width) || (y >= screen_height))
+ if (!maximize)
{
- x = y = WINDOW_POSITION_UNSET;
- }
+ x = ephy_node_get_property_int (node, EPHY_NODE_STATE_PROP_POSITION_X);
+ y = ephy_node_get_property_int (node, EPHY_NODE_STATE_PROP_POSITION_Y);
- /* If the window has a saved position set it, otherwise let the WM do it */
- if ((x != WINDOW_POSITION_UNSET) && (y != WINDOW_POSITION_UNSET))
- {
- gtk_window_move (GTK_WINDOW (window), x, y);
+ screen = gtk_window_get_screen (GTK_WINDOW (window));
+ screen_width = gdk_screen_get_width (screen);
+ screen_height = gdk_screen_get_height (screen);
+
+ if ((x >= screen_width) || (y >= screen_height))
+ {
+ x = y = WINDOW_POSITION_UNSET;
+ }
+
+ /* If the window has a saved position set it, otherwise let the WM do it */
+ if ((x != WINDOW_POSITION_UNSET) && (y != WINDOW_POSITION_UNSET))
+ {
+ gtk_window_move (GTK_WINDOW (window), x, y);
+ }
}
}
@@ -243,21 +251,31 @@ static void
ephy_state_window_save_position (GtkWidget *window, EphyNode *node)
{
int x,y;
+ gboolean maximize;
+ GdkWindowState state;
GValue value = { 0, };
+
+ state = gdk_window_get_state (GTK_WIDGET (window)->window);
+ maximize = ((state & GDK_WINDOW_STATE_MAXIMIZED) > 0);
- gtk_window_get_position (GTK_WINDOW (window), &x, &y);
+ /* Don't save the position if maximized */
- g_value_init (&value, G_TYPE_INT);
- g_value_set_int (&value, x);
- ephy_node_set_property (node, EPHY_NODE_STATE_PROP_POSITION_X,
- &value);
- g_value_unset (&value);
+ if (!maximize)
+ {
+ gtk_window_get_position (GTK_WINDOW (window), &x, &y);
- g_value_init (&value, G_TYPE_INT);
- g_value_set_int (&value, y);
- ephy_node_set_property (node, EPHY_NODE_STATE_PROP_POSITION_Y,
- &value);
- g_value_unset (&value);
+ g_value_init (&value, G_TYPE_INT);
+ g_value_set_int (&value, x);
+ ephy_node_set_property (node, EPHY_NODE_STATE_PROP_POSITION_X,
+ &value);
+ g_value_unset (&value);
+
+ g_value_init (&value, G_TYPE_INT);
+ g_value_set_int (&value, y);
+ ephy_node_set_property (node, EPHY_NODE_STATE_PROP_POSITION_Y,
+ &value);
+ g_value_unset (&value);
+ }
}
static gboolean