@@ -193,8 +193,8 @@ class GConfHandler(object):
193
193
in guake.
194
194
"""
195
195
window_rect = self .guake .get_final_window_rect ()
196
- self .guake .window .move (window_rect .x , window_rect .y )
197
196
self .guake .window .resize (window_rect .width , window_rect .height )
197
+ self .guake .window .move (window_rect .x , window_rect .y )
198
198
199
199
def scrollbar_toggled (self , client , connection_id , entry , data ):
200
200
"""If the gconf var use_scrollbar be changed, this method will
@@ -580,7 +580,7 @@ class Guake(SimpleGladeApp):
580
580
self .selected_tab = None
581
581
582
582
# holds fullscreen status
583
- self .fullscreen = False
583
+ self .is_fullscreen = False
584
584
585
585
# holds the timestamp of the losefocus event
586
586
self .losefocus_time = 0
@@ -638,6 +638,9 @@ class Guake(SimpleGladeApp):
638
638
label = gtk .accelerator_get_label (keyval , mask )
639
639
filename = pixmapfile ('guake-notification.png' )
640
640
641
+ if self .client .get_bool (KEY ('/general/start_fullscreen' )):
642
+ self .fullscreen ()
643
+
641
644
if not self .hotkeys .bind (key , self .show_hide ):
642
645
notification = pynotify .Notification (
643
646
_ ('Guake!' ),
@@ -790,9 +793,8 @@ class Guake(SimpleGladeApp):
790
793
if not self .term_list :
791
794
self .add_tab ()
792
795
793
- window_rect = self .get_final_window_rect ()
794
- self .window .move (window_rect .x , window_rect .y )
795
- self .window .resize (window_rect .width , window_rect .height )
796
+ if not self .is_fullscreen :
797
+ self .client .notify (KEY ('/general/window_height' ))
796
798
self .window .show_all ()
797
799
798
800
try :
@@ -955,36 +957,39 @@ class Guake(SimpleGladeApp):
955
957
956
958
def accel_toggle_fullscreen (self , * args ):
957
959
"""Callback toggle the fullscreen status of the main
958
- window. It uses the toolbar_visible_in_fullscreen variable
959
- from gconf to decide if the tabbar will or not be
960
- shown. Called by the accel key.
961
- """
962
- val = self .client .get_bool (KEY ('general/toolbar_visible_in_fullscreen' ))
963
-
964
- if not self .fullscreen :
965
- self .window .fullscreen ()
966
- self .fullscreen = True
967
-
968
- # The resizer widget really don't need to be shown in
969
- # fullscreen mode, but tabbar will only be shown if a
970
- # hidden gconf key is false.
971
- self .resizer .hide ()
972
- if not val :
973
- self .toolbar .hide ()
960
+ window. Called by the accel key.
961
+ """
962
+
963
+ if not self .is_fullscreen :
964
+ self .fullscreen ()
974
965
else :
975
- self .window .unfullscreen ()
976
- self .fullscreen = False
977
-
978
- # making sure that tabbar and resizer will come back to
979
- # their default state.
980
- self .client .notify (KEY ('/general/window_tabbar' ))
981
- self .client .notify (KEY ('/general/show_resizer' ))
982
- # make sure the window size is correct after returning
983
- # from fullscreen
984
- self .client .notify (KEY ('/general/window_height' ))
966
+ self .unfullscreen ()
985
967
986
968
return True
987
969
970
+ def fullscreen (self ):
971
+ self .window .fullscreen ()
972
+ self .is_fullscreen = True
973
+
974
+ # The resizer widget really don't need to be shown in
975
+ # fullscreen mode, but tabbar will only be shown if a
976
+ # hidden gconf key is false.
977
+ self .resizer .hide ()
978
+ if not self .client .get_bool (KEY ('general/toolbar_visible_in_fullscreen' )):
979
+ self .toolbar .hide ()
980
+
981
+ def unfullscreen (self ):
982
+ self .window .unfullscreen ()
983
+ self .is_fullscreen = False
984
+
985
+ # making sure that tabbar and resizer will come back to
986
+ # their default state.
987
+ self .client .notify (KEY ('/general/window_tabbar' ))
988
+ self .client .notify (KEY ('/general/show_resizer' ))
989
+ # make sure the window size is correct after returning
990
+ # from fullscreen. broken on old compiz/metacity versions :C
991
+ self .client .notify (KEY ('/general/window_height' ))
992
+
988
993
# -- callbacks --
989
994
990
995
def on_terminal_exited (self , term , widget ):
@@ -1317,6 +1322,10 @@ def main():
1317
1322
"""
1318
1323
from optparse import OptionParser
1319
1324
parser = OptionParser ()
1325
+ parser .add_option ('-f' , '--fullscreen' , dest = 'fullscreen' ,
1326
+ action = 'store_true' , default = False ,
1327
+ help = _ ('Put Guake in fullscreen mode' ))
1328
+
1320
1329
parser .add_option ('-t' , '--toggle-visibility' , dest = 'show_hide' ,
1321
1330
action = 'store_true' , default = False ,
1322
1331
help = _ ('Toggles the visibility of the terminal window' ))
@@ -1367,47 +1376,46 @@ def main():
1367
1376
remote_object = DbusManager (instance )
1368
1377
already_running = False
1369
1378
1370
- called_with_param = False
1379
+ only_show_hide = True
1371
1380
1372
- if options .show_hide :
1373
- remote_object .show_hide ()
1374
- called_with_param = True
1381
+ if options .fullscreen :
1382
+ instance .fullscreen ()
1375
1383
1376
1384
if options .show_preferences :
1377
1385
remote_object .show_prefs ()
1378
- called_with_param = True
1386
+ only_show_hide = False
1379
1387
1380
1388
if options .new_tab :
1381
1389
remote_object .add_tab (options .new_tab )
1382
- called_with_param = True
1390
+ only_show_hide = False
1383
1391
1384
1392
if options .select_tab :
1385
1393
selected = int (options .select_tab )
1386
1394
remote_object .select_tab (selected )
1387
- called_with_param = True
1395
+ only_show_hide = False
1388
1396
1389
1397
if options .selected_tab :
1390
1398
selected = remote_object .get_selected_tab ()
1391
1399
sys .stdout .write ('%d\n ' % selected )
1392
- called_with_param = True
1400
+ only_show_hide = False
1393
1401
1394
1402
if options .command :
1395
1403
remote_object .execute_command (options .command )
1396
- called_with_param = True
1404
+ only_show_hide = False
1397
1405
1398
1406
if options .rename_tab :
1399
1407
remote_object .rename_current_tab (options .rename_tab )
1400
- called_with_param = True
1408
+ only_show_hide = False
1401
1409
1402
1410
if options .show_about :
1403
1411
remote_object .show_about ()
1404
- called_with_param = True
1412
+ only_show_hide = False
1405
1413
1406
1414
if options .quit :
1407
1415
remote_object .quit ()
1408
- called_with_param = True
1416
+ only_show_hide = False
1409
1417
1410
- if not called_with_param and already_running :
1418
+ if already_running and only_show_hide :
1411
1419
# here we know that guake was called without any parameter and
1412
1420
# it is already running, so, lets toggle its visibility.
1413
1421
remote_object .show_hide ()
0 commit comments