diff options
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | callbacks.c | 18 |
3 files changed, 14 insertions, 7 deletions
@@ -38,6 +38,7 @@ In alphabetical order: Jake Probst <jake.probst@gmail.com> - uzbl_tabbed: multiline tablist James S Wheaton (uranther) - zoom level, test framework Jan Kolkmeier (jouz) - scrolling, link following + Jason Woofenden (JasonWoof) - geometry=maximized Laurence Withers (lwithers) - talk_to_socket Mark Nevill - misc patches Mason Larobina - uzbl-tabbed.py, cookie-daemon, event-manager&plugins, ... @@ -505,7 +505,7 @@ Basically all events have this format: -n, --name=NAME Name of the current instance (defaults to Xorg window id) -c, --config=FILE Path to config file or '-' for stdin -s, --socket=SOCKET Socket ID - -g, --geometry=GEOMETRY Set window geometry (format: WIDTHxHEIGHT+-X+-Y) + -g, --geometry=GEOMETRY Set window geometry (format: WIDTHxHEIGHT+-X+-Y or maximized) -V, --version Print the version and exit --display=DISPLAY X display to use --help Help diff --git a/callbacks.c b/callbacks.c index 18ea2e0..dab92c1 100644 --- a/callbacks.c +++ b/callbacks.c @@ -40,12 +40,18 @@ void cmd_set_geometry() { int ret=0, x=0, y=0; unsigned int w=0, h=0; - /* we used to use gtk_window_parse_geometry() but that didn't work how it was supposed to */ - ret = XParseGeometry(uzbl.gui.geometry, &x, &y, &w, &h); - if(ret & XValue) - gtk_window_move((GtkWindow *)uzbl.gui.main_window, x, y); - if(ret & WidthValue) - gtk_window_resize((GtkWindow *)uzbl.gui.main_window, w, h); + if(uzbl.gui.geometry) { + if(uzbl.gui.geometry[0] == 'm') { /* m/maximize/maximized */ + gtk_window_maximize((GtkWindow *)(uzbl.gui.main_window)); + } else { + /* we used to use gtk_window_parse_geometry() but that didn't work how it was supposed to */ + ret = XParseGeometry(uzbl.gui.geometry, &x, &y, &w, &h); + if(ret & XValue) + gtk_window_move((GtkWindow *)uzbl.gui.main_window, x, y); + if(ret & WidthValue) + gtk_window_resize((GtkWindow *)uzbl.gui.main_window, w, h); + } + } /* update geometry var with the actual geometry this is necessary as some WMs don't seem to honour |