added compiz options for no_decoration and fullscreen

This commit is contained in:
Mathieu Comandon 2010-09-19 23:50:52 +02:00
parent a3ef1e0892
commit e5e6d826ce
5 changed files with 62 additions and 30 deletions

View file

@ -1,16 +0,0 @@
import gtk, apt, apt.progress.gtk2
class InstallerWindow(gtk.Window):
def __init__(self,pkg_name):
gtk.Window.__init__(self)
self.set_decorated(False)
self.progress = apt.progress.gtk2.GtkAptProgress()
self.add(self.progress)
self.show_all()
cache = apt.cache.Cache(self.progress.open)
if not cache[pkg_name].isInstalled:
cache[pkg_name].markInstall()
cache.commit(self.progress.fetch, self.progress.install)
if __name__ == "__main__":
win = InstallerWindow("sdlmame")
gtk.main()

View file

@ -50,6 +50,47 @@ class LutrisDesktopControl():
type = "Boolean"
self.change_gconf_key(gconf_key, type, gconf_value)
def make_compiz_rule(self, class_=None, title=None):
if class_ is not None:
rule = 'class=%s' % class_
elif title is not None:
rule = 'title=%s' % title
else:
rule = False
return rule
def set_compiz_fullscreen(self, class_=None, title=None):
"""
Set a compiz rule for the plugin Window Rules
to make the game window fullscreen
"""
rule = self.make_compiz_rule(class_, title)
if rule is False:
return False
self.gconf.set_key(
"/apps/compiz/plugins/winrules/screen0/options/fullscreen_match",
rule,
True
)
return True
def set_compiz_nodecoration(self, class_=None, title=None):
"""
Removes the decorations for the game's window
"""
window_rule = self.make_compiz_rule(class_, title)
if window_rule is False:
return False
rule = "(any) & !(%s)" % window_rule
self.gconf.set_key(
"/apps/compiz/plugins/decoration/allscreens/options/decoration_match",
rule,
True
)
return True
def hide_panels(self, hide = True):
"""
Hide any panel that exists on the Gnome desktop

View file

@ -161,7 +161,12 @@ class LutrisGame():
shell=True
)
logging.debug("PulseAudio restarted")
if "compiz_nodecoration" in config['system']:
self.lutris_desktop_control.set_compiz_nodecoration(title=config['system']['compiz_nodecoration'])
if "compiz_fullscreen" in config['system']:
self.lutris_desktop_control.set_compiz_fullscreen(title=config['system']['compiz_fullscreen'])
path = None
if hasattr(self.machine, 'game_path'):
path = self.machine.game_path

View file

@ -114,7 +114,7 @@ class LutrisWindow(gtk.Window):
self.status_label = self.builder.get_object("status_label")
self.status_label.set_text("Ready to roll !")
for index in range(0, 3):
for index in range(4):
self.joystick_icons.append(
self.builder.get_object("js" + str(index) + "image")
)
@ -148,7 +148,7 @@ class LutrisWindow(gtk.Window):
# self.status_bar.push(self.status_bar_context_id,self.status_text)
# else:
# self.status_bar.push(self.status_bar_context_id,"Welcome to Lutris")
for index in range(0, 3):
for index in range(4):
if os.path.exists("/dev/input/js%d" % index):
self.joystick_icons[index].show()
else:

View file

@ -25,8 +25,8 @@ import logging
class SystemConfigVBox(ConfigVBox):
"""VBox for system configuration, to be inserted in main preferences, runner preferences
and game preferences"""
and game preferences"""
def __init__(self,lutris_config,caller):
"""VBox init"""
ConfigVBox.__init__(self,"system",caller)
@ -45,16 +45,18 @@ class SystemConfigVBox(ConfigVBox):
resolution_list = desktop_control.get_resolutions()
logging.debug(resolution_list)
self.options = [
{ "option": "game_path", "type": "directory_chooser", "label":"Default game path" },
{ "option": "user_wm", "type": "one_choice", "label":"Desktop Window Manager","choices": wm_list },
{ "option": "game_wm", "type": "one_choice", "label":"Gaming Window Manager","choices": wm_list },
{ "option": "resolution", "type": "one_choice", "label": "Resolution", "choices": resolution_list },
{ "option": "oss_wrapper", "type": "one_choice", "label":"OSS Wrapper","choices": oss_list },
{ "option": "reset_pulse", "type": "bool", "label":"Reset PulseAudio" },
{ "option": "hide_panels", "type": "bool", "label":"Hide Gnome Panels" },
{ 'option': 'reset_desktop', 'type': 'bool', 'label': 'Reset resolution when game quits' }
{'option': "game_path", "type": "directory_chooser", "label": "Default game path" },
{'option': "user_wm", "type": "one_choice", "label":"Desktop Window Manager","choices": wm_list },
{'option': "game_wm", "type": "one_choice", "label":"Gaming Window Manager","choices": wm_list },
{'option': "resolution", "type": "one_choice", "label": "Resolution", "choices": resolution_list },
{'option': "oss_wrapper", "type": "one_choice", "label":"OSS Wrapper","choices": oss_list },
{'option': "reset_pulse", "type": "bool", "label":"Reset PulseAudio" },
{'option': "hide_panels", "type": "bool", "label":"Hide Gnome Panels" },
{'option': 'reset_desktop', 'type': 'bool', 'label': 'Reset resolution when game quits' },
{'option': 'compiz_nodecoration', 'type': 'string', 'label': 'Remove window decoration with compiz' },
{'option': 'compiz_fullscreen', 'type': 'string', 'label': 'Make a fullscreen window with compiz' }
]
self.generate_widgets()