Hi All,
I'm trying to toggle the overriding of the window
manager key bindings (similar to -K) when
transitioning to and from full screen. So I hacked a
"new" xwin_toggle_fullscreen below...
I have a problem, though and it seems to be
intermittent. When I change from fullscreen to a
window then back to fullscreen the fullscreen loses
focus. It's really just annoying (an quick Alt-Tab
fixes it), but I would like it to run smoother since
the goal here is to add (or help add) a new option to
rdesktop. I'm new (brand new, actually) to xwindows
programming, so I'm not sure if the problem is with
some mask or something. Let me know if you can help.
Thanks,
Ryan
NEW
void
xwin_toggle_fullscreen(void)
{
Pixmap contents = 0;
if (!g_ownbackstore)
{
/* need to save contents of window */
contents = XCreatePixmap(g_display,
g_wnd, g_width, g_height, g_depth);
XCopyArea(g_display, g_wnd, contents,
g_gc, 0, 0, g_width, g_height, 0, 0);
}
ui_destroy_window();
g_fullscreen = !g_fullscreen;
if (!g_fullscreen) {
g_grab_keyboard = False;
DEBUG_KBD(("\n\nNo
Keyboard\ng_fullscreen:%d\n g_grab_keyboard:%d \n\n",
g_fullscreen, g_grab_keyboard));
} else {
g_grab_keyboard = True;
DEBUG_KBD(("\n\nKeyboard is
Back\ng_fullscreen:%d\n g_grab_keyboard:%d \n\n",
g_fullscreen, g_grab_keyboard));
}
ui_create_window();
XDefineCursor(g_display, g_wnd,
g_current_cursor);
if (!g_ownbackstore)
{
XCopyArea(g_display, contents, g_wnd,
g_gc, 0, 0, g_width, g_height, 0, 0);
XFreePixmap(g_display, contents);
}
}
PREVIOUS
void
xwin_toggle_fullscreen(void)
{
Pixmap contents = 0;
if (!g_ownbackstore)
{
/* need to save contents of window */
contents = XCreatePixmap(g_display,
g_wnd, g_width, g_height, g_depth);
XCopyArea(g_display, g_wnd, contents,
g_gc, 0, 0, g_width, g_height, 0, 0);
}
ui_destroy_window();
g_fullscreen = !g_fullscreen;
ui_create_window();
XDefineCursor(g_display, g_wnd,
g_current_cursor);
if (!g_ownbackstore)
{
XCopyArea(g_display, contents, g_wnd,
g_gc, 0, 0, g_width, g_height, 0, 0);
XFreePixmap(g_display, contents);
}
}
__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html
|