Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 872807 Details for
Bug 1071611
Please add an option to disable keyboard grab
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Patch in git format
0001-Add-a-gsetting-key-to-disable-keyboard-grabbing.patch (text/plain), 5.38 KB, created by
Kjö Hansi Glaz
on 2014-03-10 17:22:31 UTC
(
hide
)
Description:
Patch in git format
Filename:
MIME Type:
Creator:
Kjö Hansi Glaz
Created:
2014-03-10 17:22:31 UTC
Size:
5.38 KB
patch
obsolete
>From 3c3928e7fd8f9db3c3438feb5a3d31b66b20fff7 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Kj=C3=B6=20Hansi=20Glaz?= <kjo@a4nancy.net.eu.org> >Date: Mon, 10 Mar 2014 18:07:15 +0100 >Subject: [PATCH] Add a gsetting key to disable keyboard grabbing > >Add a gsetting key to disable keyboard grabbing that works the same way >as spicy when unchecking "Options" > "Grab keyboard when active and >focused". >--- > data/org.virt-manager.virt-manager.gschema.xml | 7 +++++++ > virtManager/config.py | 8 ++++++++ > virtManager/console.py | 22 +++++++++++++++++++++- > 3 files changed, 36 insertions(+), 1 deletion(-) > >diff --git a/data/org.virt-manager.virt-manager.gschema.xml b/data/org.virt-manager.virt-manager.gschema.xml >index d755f6e..2fede6c 100644 >--- a/data/org.virt-manager.virt-manager.gschema.xml >+++ b/data/org.virt-manager.virt-manager.gschema.xml >@@ -188,6 +188,13 @@ > <description>Grab keyboard sequence for the graphical console</description> > </key> > >+ <!--This key is not intended to be exposed in the UI yet--> >+ <key name="grab-keyboard" type="b"> >+ <default>true</default> >+ <summary>Enable grab keyboard when active and focused</summary> >+ <description>Enable grab keyboard when active and focused</description> >+ </key> >+ > <key name="auto-redirect" type="b"> > <default>true</default> > <summary>Enable SPICE Auto USB redirection in console window</summary> >diff --git a/virtManager/config.py b/virtManager/config.py >index dd624e9..5c9c127 100644 >--- a/virtManager/config.py >+++ b/virtManager/config.py >@@ -286,6 +286,14 @@ class vmmConfig(object): > def on_keys_combination_changed(self, cb): > return self.conf.notify_add("/console/grab-keys", cb) > >+ # This key is not intended to be exposed in the UI yet >+ def get_grab_keyboard(self): >+ return self.conf.get("/console/grab-keyboard") >+ def set_grab_keyboard(self, val): >+ self.conf.set("/console/grab-keyboard", val) >+ def on_grab_keyboard_changed(self, cb): >+ return self.conf.notify_add("/console/grab-keyboard", cb) >+ > # Confirmation preferences > def get_confirm_forcepoweroff(self): > return self.conf.get("/confirm/forcepoweroff") >diff --git a/virtManager/console.py b/virtManager/console.py >index 6513645..ee12390 100644 >--- a/virtManager/console.py >+++ b/virtManager/console.py >@@ -360,6 +360,9 @@ class Viewer(vmmGObject): > def send_keys(self, keys): > raise NotImplementedError() > >+ def set_grab_keyboard(self): >+ raise NotImplementedError() >+ > def open_host(self, ginfo): > raise NotImplementedError() > >@@ -394,6 +397,7 @@ class VNCViewer(Viewer): > > def init_widget(self): > self.set_grab_keys() >+ self.set_grab_keyboard() > > self.display.realize() > >@@ -403,7 +407,6 @@ class VNCViewer(Viewer): > self.console.sync_scaling_with_display() > self.console.refresh_resizeguest_from_settings() > >- self.display.set_keyboard_grab(True) > self.display.set_pointer_grab(True) > > self.display.connect("size-allocate", >@@ -461,6 +464,10 @@ class VNCViewer(Viewer): > def send_keys(self, keys): > return self.display.send_keys([Gdk.keyval_from_name(k) for k in keys]) > >+ def set_grab_keyboard(self): >+ self.display.set_keyboard_grab(self.config.get_grab_keyboard()) >+ self.display.force_grab(self.config.get_grab_keyboard()) >+ > def _desktop_resize(self, src_ignore, w, h): > self.desktop_resolution = (w, h) > self.console.widget("console-gfx-scroll").queue_resize() >@@ -571,6 +578,7 @@ class SpiceViewer(Viewer): > > def _init_widget(self): > self.set_grab_keys() >+ self.set_grab_keyboard() > self.console.sync_scaling_with_display() > self.console.refresh_resizeguest_from_settings() > >@@ -617,6 +625,9 @@ class SpiceViewer(Viewer): > return self.display.send_keys([Gdk.keyval_from_name(k) for k in keys], > SpiceClientGtk.DisplayKeyEvent.CLICK) > >+ def set_grab_keyboard(self): >+ self.display.set_property("grab-keyboard", self.config.get_grab_keyboard()) >+ > def close(self): > if self.spice_session is not None: > self.spice_session.disconnect() >@@ -875,6 +886,8 @@ class vmmConsolePages(vmmGObjectUI): > self.config.on_console_accels_changed(self.set_enable_accel)) > self.add_gconf_handle( > self.config.on_keys_combination_changed(self.grab_keys_changed)) >+ self.add_gconf_handle( >+ self.config.on_grab_keyboard_changed(self.grab_keyboard_changed)) > > self.page_changed() > >@@ -1027,6 +1040,9 @@ class vmmConsolePages(vmmGObjectUI): > def pointer_grabbed(self, src_ignore): > self.pointer_is_grabbed = True > self.change_title() >+ if not self.config.get_grab_keyboard(): >+ self.viewer.display.force_grab(False) >+ self.viewer.display.set_keyboard_grab(self.config.get_grab_keyboard()) > > def pointer_ungrabbed(self, src_ignore): > self.pointer_is_grabbed = False >@@ -1067,6 +1083,10 @@ class vmmConsolePages(vmmGObjectUI): > if self.viewer: > self.viewer.set_grab_keys() > >+ def grab_keyboard_changed(self): >+ if self.viewer: >+ self.viewer.set_grab_keyboard() >+ > def set_enable_accel(self): > # Make sure modifiers are up to date > self.viewer_focus_changed() >-- >1.9.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1071611
:
869664
| 872807