コード例 #1
0
ファイル: view.py プロジェクト: romannamor9/vmnetx
 def _new_channel(self, session, channel):
     if session != self._session:
         # Stale channel; ignore
         return
     GObject.connect(channel, 'open-fd', self._request_fd)
     GObject.connect(channel, 'channel-event', self._channel_event)
     type = SpiceClientGtk.spice_channel_type_to_string(
             channel.get_property('channel-type'))
     if type == 'display':
         # Create the display but don't show it until configured by
         # the server
         GObject.connect(channel, 'display-primary-create',
                 self._display_create)
         self._destroy_display()
         self._display_channel = channel
         self._display = SpiceClientGtk.Display(self._session,
                 channel.get_property('channel-id'))
         # Default was False in spice-gtk < 0.14
         self._display.set_property('scaling', True)
         self._display.connect('size-request', self._size_request)
         self._display.connect('keyboard-grab', self._grab, 'keyboard')
         self._display.connect('mouse-grab', self._grab, 'mouse')
         if self._motion_interval is not None:
             self._display.connect('motion-notify-event', self._motion)
     elif type == 'playback':
         if self._audio is None:
             try:
                 # Enable audio
                 self._audio = SpiceClientGtk.Audio(self._session)
             except RuntimeError:
                 # No local PulseAudio, etc.
                 pass
コード例 #2
0
ファイル: view.py プロジェクト: dayoonc/vmnetx
 def _new_channel(self, _session, channel):
     channel.connect_object('open-fd', self._request_fd, channel)
     channel.connect_object('channel-event', self._channel_event, channel)
     type = SpiceClientGtk.spice_channel_type_to_string(
             channel.get_property('channel-type'))
     if type == 'display':
         self._destroy_display()
         self.remove(self._placeholder)
         self.add(self._aspect)
         self._display = SpiceClientGtk.Display(self._session,
                 channel.get_property('channel-id'))
         # Default was False in spice-gtk < 0.14
         self._display.set_property('scaling', True)
         self._display.connect('size-request', self._size_request)
         self._display.connect('keyboard-grab', self._grab, 'keyboard')
         self._display.connect('mouse-grab', self._grab, 'mouse')
         self._aspect.add(self._display)
         self._aspect.show_all()
         self.emit('viewer-connect')
コード例 #3
0
ファイル: view.py プロジェクト: jaharkes/vmnetx
 def _new_channel(self, session, channel):
     if session != self._session:
         # Stale channel; ignore
         return
     GObject.connect(channel, 'open-fd', self._request_fd)
     GObject.connect(channel, 'channel-event', self._channel_event)
     type = SpiceClientGtk.spice_channel_type_to_string(
             channel.get_property('channel-type'))
     if type == 'display':
         # Create the display but don't show it until configured by
         # the server
         GObject.connect(channel, 'display-primary-create',
                 self._display_create)
         self._destroy_display()
         self._display_channel = channel
         self._display = SpiceClientGtk.Display(self._session,
                 channel.get_property('channel-id'))
         # Default was False in spice-gtk < 0.14
         self._display.set_property('scaling', True)
         self._display.connect('size-request', self._size_request)
         self._display.connect('keyboard-grab', self._grab, 'keyboard')
         self._display.connect('mouse-grab', self._grab, 'mouse')
         self._connect_display_signals(self._display)
コード例 #4
0
 def _new_channel(self, session, channel):
     if session != self._session:
         # Stale channel; ignore
         return
     channel.connect_object('open-fd', self._request_fd, channel)
     channel.connect_object('channel-event', self._channel_event, channel)
     type = SpiceClientGtk.spice_channel_type_to_string(
             channel.get_property('channel-type'))
     if type == 'display':
         # Create the display but don't show it until configured by
         # the server
         channel.connect_object('display-primary-create',
                 self._display_create, channel)
         self._destroy_display()
         self._display_channel = channel
         self._display = SpiceClientGtk.Display(self._session,
                 channel.get_property('channel-id'))
         # Default was False in spice-gtk < 0.14
         self._display.set_property('scaling', True)
         self._display.connect('size-request', self._size_request)
         self._display.connect('keyboard-grab', self._grab, 'keyboard')
         self._display.connect('mouse-grab', self._grab, 'mouse')
         self._connect_display_signals(self._display)