Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2:Test
gnome-screensaver
gnome-screensaver-xvkbd-on-lock.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gnome-screensaver-xvkbd-on-lock.patch of Package gnome-screensaver
diff -upr gnome-screensaver-2.20.0-orig/src/gnome-screensaver-dialog.c gnome-screensaver-2.20.0/src/gnome-screensaver-dialog.c --- gnome-screensaver-2.20.0-orig/src/gnome-screensaver-dialog.c 2007-09-17 23:15:11.000000000 +0200 +++ gnome-screensaver-2.20.0/src/gnome-screensaver-dialog.c 2007-10-04 12:43:28.000000000 +0200 @@ -109,10 +109,17 @@ response_ok (void) fflush (stdout); } +static GPid xvkbd_pid; +static gboolean xvkbd_running = FALSE; + static gboolean quit_response_ok (void) { response_ok (); + + if (xvkbd_running) + kill (xvkbd_pid, 9); + gtk_main_quit (); return FALSE; } @@ -121,6 +128,10 @@ static gboolean quit_response_cancel (void) { response_cancel (); + + if (xvkbd_running) + kill (xvkbd_pid, 9); + gtk_main_quit (); return FALSE; } @@ -566,10 +577,27 @@ main (int argc, gs_debug_init (verbose, FALSE); + int status = system ("hal-find-by-property --key system.formfactor.subtype --string tabletpc"); + if (WIFEXITED (status) && WEXITSTATUS (status) == 0) { + gchar **arguments[] = { "/usr/bin/xvkbd", "-always-on-top", "-compact", "-geometry", "-0-0", NULL }; + error = NULL; + + if (g_spawn_async (g_get_home_dir (), arguments, NULL, 0, NULL, NULL, + &xvkbd_pid, &error)) + xvkbd_running = TRUE; + else { + g_warning ("Could not spawn xvkbd: %s\n", error->message); + g_error_free (error); + + } + } g_idle_add ((GSourceFunc)popup_dialog_idle, NULL); gtk_main (); + if (xvkbd_running) + kill (xvkbd_pid, 9); + gs_profile_end (NULL); gs_debug_shutdown (); Only in gnome-screensaver-2.20.0/src: gnome-screensaver-dialog.c~ Only in gnome-screensaver-2.20.0/src: gs-lock-plug.c~ Only in gnome-screensaver-2.20.0/src: gs-lock-plug.c.orig diff -upr gnome-screensaver-2.20.0-orig/src/gs-window-x11.c gnome-screensaver-2.20.0/src/gs-window-x11.c --- gnome-screensaver-2.20.0-orig/src/gs-window-x11.c 2007-09-17 23:15:11.000000000 +0200 +++ gnome-screensaver-2.20.0/src/gs-window-x11.c 2007-10-04 00:09:24.000000000 +0200 @@ -647,6 +647,49 @@ x11_window_is_ours (Window window) return ret; } +#define GET_DISPLAY gdk_x11_display_get_xdisplay (gdk_display_get_default ()) + +GdkWindow *xvkbd_window = NULL; + +static gboolean +is_xvkbd_window (Window window) +{ + gboolean ret = FALSE; + XClassHint class_hint = { NULL, NULL }; + + gdk_error_trap_push (); + if (XGetClassHint (GET_DISPLAY, window, &class_hint)) { + if (g_strstr_len (class_hint.res_name, + strlen (class_hint.res_name), + "xvkbd")) + ret = TRUE; + } + + if (G_UNLIKELY (gdk_error_trap_pop () == BadWindow)) ; + + return ret; +} + +static void +setup_xvkbd_window (GSWindow *gswindow, Window window) +{ + gs_debug ("Setting up xvkbd_window from window %d", (int) window); + + xvkbd_window = gdk_window_foreign_new (window); + gdk_window_hide (xvkbd_window); + gdk_window_set_override_redirect (xvkbd_window, TRUE); + gdk_window_set_events (xvkbd_window, gdk_window_get_events (xvkbd_window) | GDK_STRUCTURE_MASK); + + int display_width, display_height, width, height; + GdkWindow *root = gdk_screen_get_root_window (gdk_drawable_get_screen (xvkbd_window)); + + gdk_window_get_geometry (xvkbd_window, NULL, NULL, &width, &height, NULL); + gdk_window_get_geometry (root, NULL, NULL, &display_width, &display_height, NULL); + gdk_window_reparent (xvkbd_window, NULL, display_width - width, display_height - height); + gdk_window_set_transient_for (xvkbd_window, GTK_WIDGET (gswindow)->window); + gdk_window_show (xvkbd_window); +} + #ifdef HAVE_SHAPE_EXT static void unshape_window (GSWindow *window) @@ -669,6 +712,16 @@ gs_window_xevent (GSWindow *window, /* MapNotify is used to tell us when new windows are mapped. ConfigureNofify is used to tell us when windows are raised. */ switch (ev->xany.type) { + case CreateNotify : + { + XCreateWindowEvent *create_event; + + create_event = &ev->xcreatewindow; + if (!x11_window_is_ours (create_event->window) && is_xvkbd_window (create_event->window)) + setup_xvkbd_window (window, create_event->window); + + break; + } case MapNotify: { XMapEvent *xme = &ev->xmap; @@ -686,7 +739,7 @@ gs_window_xevent (GSWindow *window, XConfigureEvent *xce = &ev->xconfigure; if (! x11_window_is_ours (xce->window)) { - gs_window_raise (window); + gs_window_raise (window); } else { gs_debug ("not raising our windows"); } Only in gnome-screensaver-2.20.0/src: gs-window-x11.c~ Only in gnome-screensaver-2.20.0/src: gs-window-x11.c.orig
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor