slackbuilds_ponce/desktop/gmrun/patches/90-window_placement.patch
Edinaldo P.Silva e3a478c576 desktop/gmrun: New maintainer + add manpage & patches.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
2017-03-10 09:50:48 +00:00

50 lines
1.4 KiB
Diff

# 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>
Index: gmrun-0.9.2/config/gmrunrc
===================================================================
--- gmrun-0.9.2.orig/config/gmrunrc 2010-02-04 21:55:11.968469321 +0800
+++ gmrun-0.9.2/config/gmrunrc 2010-02-04 21:55:14.860466459 +0800
@@ -9,8 +9,6 @@
# Set window geometry (except height)
Width = 400
-Top = 100
-Left = 200
# History size
History = 256
Index: gmrun-0.9.2/src/main.cc
===================================================================
--- gmrun-0.9.2.orig/src/main.cc 2010-02-04 21:55:22.104464288 +0800
+++ gmrun-0.9.2/src/main.cc 2010-02-04 21:56:42.232468582 +0800
@@ -629,8 +629,8 @@
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 @@
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);