Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal bringup under GNOME Wayland #951

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/jarabe/frame/eventarea.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from gi.repository import Gdk
from gi.repository import GObject
from gi.repository import GLib
from gi.repository import Wnck

from sugar3.graphics import style

Expand Down Expand Up @@ -51,10 +50,6 @@ def __init__(self, settings):
settings.connect('changed', self._settings_changed_cb)
self._settings_changed_cb(settings, None)

screen = Wnck.Screen.get_default()
screen.connect('window-stacking-changed',
self._window_stacking_changed_cb)

def _box(self, tag):
box = Gtk.Invisible()
box.connect('enter-notify-event', self._enter_notify_cb)
Expand Down Expand Up @@ -152,7 +147,3 @@ def show(self):
def hide(self):
for box in list(self._boxes.values()):
box.hide()

def _window_stacking_changed_cb(self, screen):
for box in list(self._boxes.values()):
box.get_window().raise_()
8 changes: 0 additions & 8 deletions src/jarabe/journal/objectchooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from gi.repository import GObject
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Wnck

from sugar3.graphics import style
from sugar3.graphics.toolbutton import ToolButton
Expand Down Expand Up @@ -65,9 +64,6 @@ def __init__(self, parent=None, what_filter='', filter_type=None,
else:
self.connect('realize', self.__realize_cb, parent)

screen = Wnck.Screen.get_default()
screen.connect('window-closed', self.__window_closed_cb, parent)

vbox = Gtk.VBox()
self.add(vbox)
vbox.show()
Expand Down Expand Up @@ -116,10 +112,6 @@ def __realize_cb(self, chooser, parent):
self.get_window().set_transient_for(parent)
# TODO: Should we disconnect the signal here?

def __window_closed_cb(self, screen, window, parent):
if window.get_xid() == parent.get_xid():
self.destroy()

def __entry_activated_cb(self, list_view, uid):
self._selected_object_id = uid
self.emit('response', Gtk.ResponseType.ACCEPT)
Expand Down
12 changes: 0 additions & 12 deletions src/jarabe/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,12 @@
# define the versions of used libraries that are required
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gst', '1.0')
gi.require_version('Wnck', '3.0')
gi.require_version('SugarExt', '1.0')
gi.require_version('GdkX11', '3.0')

from gi.repository import Gio
from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import Gst
from gi.repository import Wnck

from sugar3 import env

Expand Down Expand Up @@ -204,12 +200,6 @@ def _start_window_manager():

_restart_window_manager()

screen = Wnck.Screen.get_default()
screen.connect('window-manager-changed', __window_manager_changed_cb)

_check_for_window_manager(screen)


def _stop_window_manager():
_cursor_theme_settings.set_string('cursor-theme', _cursor_theme)
_metacity_process.terminate()
Expand Down Expand Up @@ -340,8 +330,6 @@ def _check_group_label():


def main():
Gst.init(sys.argv)

cleanup_temporary_files()

_start_window_manager()
Expand Down
42 changes: 2 additions & 40 deletions src/jarabe/model/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,13 @@
import logging

import gi
gi.require_version('Xkl', '1.0')
from gi.repository import Gio
from gi.repository import GdkX11
from gi.repository import Xkl


def setup():
settings = Gio.Settings.new('org.sugarlabs.peripherals.keyboard')
have_config = False

try:
display = GdkX11.x11_get_default_xdisplay()
if display is not None:
engine = Xkl.Engine.get_instance(display)
else:
logging.debug('setup_keyboard_cb: Could not get default display.')
return

configrec = Xkl.ConfigRec()
configrec.get_from_server(engine)

layouts = settings.get_strv('layouts')
layouts_list = []
variants_list = []
if layouts:
for layout in layouts:
layouts_list.append(layout.split('(')[0])
variants_list.append(layout.split('(')[1][:-1])

if layouts_list and variants_list:
have_config = True
configrec.set_layouts(layouts_list)
configrec.set_variants(variants_list)

model = settings.get_string('model')
if model:
have_config = True
configrec.set_model(model)

options = settings.get_strv('options')
if options:
have_config = True
configrec.set_options(options)

if have_config:
configrec.activate(engine)
except Exception:
logging.exception('Error during keyboard configuration')
logging.debug('setup_keyboard_cb: Could not get default display.')
return
10 changes: 0 additions & 10 deletions src/jarabe/model/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import time

from gi.repository import Gio
from gi.repository import Wnck
from gi.repository import GObject
from gi.repository import Gtk
from gi.repository import Gdk
Expand Down Expand Up @@ -399,12 +398,6 @@ class ShellModel(GObject.GObject):
def __init__(self):
GObject.GObject.__init__(self)

self._screen = Wnck.Screen.get_default()
self._screen.connect('window-opened', self._window_opened_cb)
self._screen.connect('window-closed', self._window_closed_cb)
self._screen.connect('active-window-changed',
self._active_window_changed_cb)

self.zoom_level_changed = dispatch.Signal()

self._desktop_level = self.ZOOM_HOME
Expand All @@ -417,8 +410,6 @@ def __init__(self):
self._launchers = {}
self._modal_dialogs_counter = 0

self._screen.toggle_showing_desktop(True)

settings = Gio.Settings.new('org.sugarlabs')
self._maximum_open_activities = settings.get_int(
'maximum-number-of-open-activities')
Expand Down Expand Up @@ -462,7 +453,6 @@ def set_zoom_level(self, new_level, x_event_time=0):
new_level=new_level)

show_desktop = new_level is not self.ZOOM_ACTIVITY
self._screen.toggle_showing_desktop(show_desktop)

if new_level is self.ZOOM_ACTIVITY:
# activate the window, in case it was iconified
Expand Down
7 changes: 0 additions & 7 deletions src/jarabe/model/speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from sugar3.speech import SpeechManager


_speech_manager = None


def get_speech_manager():
global _speech_manager

if _speech_manager is None:
_speech_manager = SpeechManager()
if not _speech_manager.enabled():
_speech_manager = None
return _speech_manager
3 changes: 0 additions & 3 deletions src/jarabe/view/cursortracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

from gi.repository import Gdk

from gi.repository import SugarExt

_instance = None


Expand All @@ -42,7 +40,6 @@ def setup():
if device.get_source() == Gdk.InputSource.TOUCHSCREEN:
logging.debug('Cursor Tracker: found touchscreen, '
'will track input.')
_instance = SugarExt.CursorTracker()
break

if not _instance:
Expand Down