merge window role branch from Soldatov Dmitry

This commit is contained in:
Chris Jones 2009-11-24 12:35:30 +00:00
commit 92f240f29f
2 changed files with 8 additions and 2 deletions

View File

@ -97,6 +97,8 @@ if __name__ == '__main__':
inside the terminal") inside the terminal")
parser.add_option ("--working-directory", metavar="DIR", parser.add_option ("--working-directory", metavar="DIR",
dest="working_directory", help="Set the terminal's working directory") dest="working_directory", help="Set the terminal's working directory")
parser.add_option ("-r", "--role", dest="role",
help="Set custom WM_WINDOW_ROLE property")
for item in ['--sm-client-id', '--sm-config-prefix', '--screen']: for item in ['--sm-client-id', '--sm-config-prefix', '--screen']:
parser.add_option (item, dest="dummy", action="store", help=SUPPRESS_HELP) parser.add_option (item, dest="dummy", action="store", help=SUPPRESS_HELP)
@ -160,7 +162,7 @@ See the following bug report for more details:
dbg ('profile_cb: settled on profile: "%s"' % options.profile) dbg ('profile_cb: settled on profile: "%s"' % options.profile)
term = Terminator (options.profile, command, options.fullscreen, term = Terminator (options.profile, command, options.fullscreen,
options.maximise, options.borderless, options.no_gconf, options.maximise, options.borderless, options.no_gconf,
options.geometry, options.hidden, options.forcedtitle) options.geometry, options.hidden, options.forcedtitle, options.role)
term.origcwd = origcwd term.origcwd = origcwd

View File

@ -45,6 +45,7 @@ class TerminatorWindowTitle:
_window = None _window = None
text = None text = None
_forced = False _forced = False
_role = None
def __init__ (self, window): def __init__ (self, window):
self._window = window self._window = window
@ -168,7 +169,7 @@ class Terminator:
def __init__ (self, profile = None, command = None, fullscreen = False, def __init__ (self, profile = None, command = None, fullscreen = False,
maximise = False, borderless = False, no_gconf = False, maximise = False, borderless = False, no_gconf = False,
geometry = None, hidden = False, forcedtitle = None): geometry = None, hidden = False, forcedtitle = None, role=None):
self.profile = profile self.profile = profile
self.command = command self.command = command
@ -267,6 +268,9 @@ class Terminator:
self.set_closebutton_style () self.set_closebutton_style ()
self.window = gtk.Window () self.window = gtk.Window ()
if role:
self.window.set_role(role)
self.windowtitle = TerminatorWindowTitle (self.window) self.windowtitle = TerminatorWindowTitle (self.window)
if forcedtitle: if forcedtitle:
self.windowtitle.force_title (forcedtitle) self.windowtitle.force_title (forcedtitle)