Allow running GTK3 Sugar Activities in HTML5

This commit is contained in:
Sebastian Silva 2016-06-04 22:31:24 -05:00
parent 52ce5af493
commit 966c65082e

View File

@ -1129,9 +1129,16 @@ class Activity(Window, Gtk.Container):
self._complete_close() self._complete_close()
def __realize_cb(self, window): def __realize_cb(self, window):
display_name = Gdk.Display.get_default().get_name()
if ':' in display_name:
# X11 for sure; this only works in X11
xid = window.get_window().get_xid() xid = window.get_window().get_xid()
SugarExt.wm_set_bundle_id(xid, self.get_bundle_id()) SugarExt.wm_set_bundle_id(xid, self.get_bundle_id())
SugarExt.wm_set_activity_id(xid, str(self._activity_id)) SugarExt.wm_set_activity_id(xid, str(self._activity_id))
elif display_name is 'Broadway':
# GTK3's HTML5 backend
# This is needed so that the window takes the whole browser window
self.maximize()
def __delete_event_cb(self, widget, event): def __delete_event_cb(self, widget, event):
self.close() self.close()