aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jason Woofenden <jason@jasonwoof.com>2009-12-08 11:04:44 -0500
committerGravatar Jason Woofenden <jason@jasonwoof.com>2009-12-08 12:21:04 -0500
commitcd213e0c96502b6638eef0816be44791d1d8bfac (patch)
treec83ec31c1b1a24e3f1e3fdbac24fe3281e858f56
parentc150136f5b772c35a633afadecf6e3e491ff4ae4 (diff)
added support for geometry=maximized
-rw-r--r--README2
-rw-r--r--callbacks.c18
2 files changed, 13 insertions, 7 deletions
diff --git a/README b/README
index 23b0f4e..0afec46 100644
--- a/README
+++ b/README
@@ -496,7 +496,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..72ef7e7 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(strcmp(uzbl.gui.geometry, "maximized") == 0) {
+ 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