Ticket #602: 0001-Change-window-management-stuff-so-Sugar-can-use-a-st.patch

File 0001-Change-window-management-stuff-so-Sugar-can-use-a-st.patch, 2.8 KB (added by tomeu, 15 years ago)
  • bin/sugar-emulator

    From 65ca7b151dc27c708b60db1152cfbb62d2a87aac Mon Sep 17 00:00:00 2001
    From: Tomeu Vizoso <tomeu@sugarlabs.org>
    Date: Sun, 21 Jun 2009 12:36:52 +0200
    Subject: [PATCH] Change window management stuff so Sugar can use a standard-compliants window manager
    
    ---
     bin/sugar-emulator              |   10 ----------
     bin/sugar.in                    |    3 +--
     src/jarabe/frame/framewindow.py |    2 +-
     src/jarabe/model/shell.py       |    6 ++++++
     4 files changed, 8 insertions(+), 13 deletions(-)
    
    diff --git a/bin/sugar-emulator b/bin/sugar-emulator
    index acd5976..3be59f0 100644
    a b def _start_xephyr(dpi, dimensions, fullscreen): 
    8888                    tries -= 1
    8989                    time.sleep(0.1)
    9090
    91 def _start_matchbox():
    92     cmd = ['matchbox-window-manager']
    93 
    94     cmd.extend(['-use_titlebar', 'no'])
    95     cmd.extend(['-theme', 'sugar'])
    96 
    97     gobject.spawn_async(cmd, flags=gobject.SPAWN_SEARCH_PATH)
    98 
    9991def _setup_env():
    10092    os.environ['SUGAR_EMULATOR'] = 'yes'
    10193    os.environ['GABBLE_LOGFILE'] = os.path.join(
    def main(): 
    157149    if not args:
    158150        command.append('sugar')
    159151    else:
    160         _start_matchbox()
    161 
    162152        if args[0].endswith('.py'):
    163153            command.append('python')
    164154
  • bin/sugar.in

    diff --git a/bin/sugar.in b/bin/sugar.in
    index 3c9b9b6..7b5ca25 100644
    a b if [ -f ~/.sugar/debug ]; then 
    1616        . ~/.sugar/debug
    1717fi
    1818
    19 matchbox-window-manager -use_titlebar no -theme sugar \
    20                         -kbdconfig @prefix@/share/sugar/data/kbdconfig &
     19metacity --no-force-fullscreen &
    2120
    2221exec sugar-session
  • src/jarabe/frame/framewindow.py

    diff --git a/src/jarabe/frame/framewindow.py b/src/jarabe/frame/framewindow.py
    index 02bb131..5cb1241 100644
    a b class FrameWindow(gtk.Window): 
    9393            self.resize(self.size, gtk.gdk.screen_height())
    9494
    9595    def _realize_cb(self, widget):
    96         self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)
     96        self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DOCK)
    9797        self.window.set_accept_focus(False)
    9898
    9999    def _enter_notify_cb(self, window, event):
  • src/jarabe/model/shell.py

    diff --git a/src/jarabe/model/shell.py b/src/jarabe/model/shell.py
    index 709eb03..d7810ba 100644
    a b class ShellModel(gobject.GObject): 
    457457            if activity_id:
    458458                home_activity = self.get_activity_by_id(activity_id)
    459459
     460                xid = window.get_xid()
     461                gdk_window = gtk.gdk.window_foreign_new(xid)
     462                gdk_window.set_decorations(0)
     463
     464                window.maximize()
     465
    460466            if not home_activity:
    461467                home_activity = Activity(activity_info, activity_id, window)
    462468                self._add_activity(home_activity)