From cd213e0c96502b6638eef0816be44791d1d8bfac Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Tue, 8 Dec 2009 11:04:44 -0500 Subject: added support for geometry=maximized --- callbacks.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'callbacks.c') 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 -- cgit v1.2.3