summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre De Dommelin <adedommelin@tuxz.net>2017-03-12 15:49:46 -0700
committerLukas Schwaighofer <lukas@schwaighofer.name>2017-03-12 15:49:46 -0700
commit618a1346a43a681a91fb1bf2998e3d4457395b7b (patch)
tree53be79ebcd81531307f7c81a5afcdfd89b6fdf6b
parent81aca38adc5c0464aea327967d153346949bb6fb (diff)
window_placement
# Description: Update window placement # If the user hasn't set any position prefs (Top or Left directives), then # center the window # Bug-Debian: http://bugs.debian.org/471319 # Author: Vincent Legout <vincent@legout.info> Gbp-Pq: Name 90-window_placement.patch
-rw-r--r--config/gmrunrc2
-rw-r--r--src/main.cc10
2 files changed, 7 insertions, 5 deletions
diff --git a/config/gmrunrc b/config/gmrunrc
index 6262694..80503e3 100644
--- a/config/gmrunrc
+++ b/config/gmrunrc
@@ -9,8 +9,6 @@ AlwaysInTerm = ssh telnet ftp lynx mc vi vim pine centericq perldoc man
# Set window geometry (except height)
Width = 400
-Top = 100
-Left = 200
# History size
History = 256
diff --git a/src/main.cc b/src/main.cc
index 649490c..6ebdb6f 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -629,8 +629,8 @@ int main(int argc, char **argv)
gtk_box_pack_start(GTK_BOX(hbox), compline, TRUE, TRUE, 0);
- int prefs_top = 80;
- int prefs_left = 100;
+ int prefs_top = -1;
+ int prefs_left = -1;
configuration.get_int("Top", prefs_top);
configuration.get_int("Left", prefs_left);
@@ -659,10 +659,14 @@ int main(int argc, char **argv)
geo_parsed = gtk_window_parse_geometry (GTK_WINDOW (win),
geoptr);
}
- else
+ else if (prefs_top != -1 && prefs_left != -1)
{
gtk_widget_set_uposition(win, prefs_left, prefs_top);
}
+ else
+ {
+ gtk_window_set_position (GTK_WINDOW (win), GTK_WIN_POS_CENTER);
+ }
gtk_widget_show(win);