Re: rdesktop

"Benjamin R. Haskell" <[email protected]>
Newsgroups gmane.comp.window-managers.ion.general
Message-ID <[email protected]>
On Thu, 11 Dec 2008, Albert Shih wrote:

> Le 11/12/2008 à 10:14:52+0100, Albert Shih a écrit
>> Hi all,
>>
>> I'm using....sorry...a old version of ion.
>>
>> I've a problem, I don't knwon if it's come from my old version or it's 
>> because my config is not complete.
>>
>> My version of ION is 3rc-20070927 on FreeBSD.
>>
>> My problem is with rdesktop :
>>
>> 	Sometime I need rdesktop to connect on a windows server.
>> 	After rdesktop is launch I can not use the short-key to change
>> 	workplace (only the workplace where run rdesktop). I need to click
>> 	on the top of the workplace, after that i can use short-key.
>>
>> of course that's not big problem. But if you can tell me how can I fix 
>> it.
>>
>> Thanks for your help ?
>
> Someone tell me the solution (thanks to him).
>
> In fact it's rdesktop to grab the keyboard.
>
> So to avoid this problem :
>
> 	rdesktop -K instead rdesktop
>
> regards.

I haven't fully committed to Ion yet, but it always annoyed me that 
rdesktop did this. It was surprisingly easy to add a keyboard shortcut to 
get rdesktop to release the keyboard. The attached patch is against 
rdesktop-1.6.0.

I chose Ctrl+Alt+Shift+Enter as the key to perform the "un-grab". (Mainly 
because it's very unlikely I'd ever use that in Windows, but also because 
there was already a shortcut for Ctrl+Alt+Enter.)

Best,
Ben
rdesktop-keyboard.patch (text/plain, 724 B)
--- xkeymap.c.orig	2007-10-08 08:34:05.000000000 -0400
+++ xkeymap.c	2008-12-12 23:55:00.000000000 -0500
@@ -514,10 +514,17 @@
 			    && (get_key_state(state, XK_Control_L)
 				|| get_key_state(state, XK_Control_R)))
 			{
-				/* Ctrl-Alt-Enter: toggle full screen */
-				if (pressed)
-					xwin_toggle_fullscreen();
-				return True;
+				if (get_key_state(state, XK_Shift_L) || get_key_state(state, XK_Shift_R))
+				{
+					/* Ctrl-Alt-Shift-Enter: release keyboard */
+					XUngrabKeyboard(g_display, CurrentTime);
+					return True;
+				} else {
+					/* Ctrl-Alt-Enter: toggle full screen */
+					if (pressed)
+						xwin_toggle_fullscreen();
+					return True;
+				}
 			}
 			break;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.