Bugzilla – Attachment 176628 Details for
Bug 304399
login not possible when a tablet is used
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
New version of the patch with Federico's suggestions
gnome-screensaver-xvkbd-on-lock.patch (text/plain), 5.49 KB, created by
Rodrigo Moya
on 2007-10-06 15:24:49 UTC
(
hide
)
Description:
New version of the patch with Federico's suggestions
Filename:
MIME Type:
Creator:
Rodrigo Moya
Created:
2007-10-06 15:24:49 UTC
Size:
5.49 KB
patch
obsolete
>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-06 17:23:36.000000000 +0200 >@@ -109,10 +109,22 @@ response_ok (void) > fflush (stdout); > } > >+static GPid xvkbd_pid; >+static gboolean xvkbd_running = FALSE; >+ >+static void >+kill_xvkbd (void) >+{ >+ if (xvkbd_running) >+ kill (xvkbd_pid, 9); >+ >+} >+ > static gboolean > quit_response_ok (void) > { > response_ok (); >+ kill_xvkbd (); > gtk_main_quit (); > return FALSE; > } >@@ -121,6 +133,7 @@ static gboolean > quit_response_cancel (void) > { > response_cancel (); >+ kill_xvkbd (); > gtk_main_quit (); > return FALSE; > } >@@ -566,10 +579,34 @@ main (int argc, > > gs_debug_init (verbose, FALSE); > >+ gint status; >+ >+ error = NULL; >+ if (g_spawn_command_line_sync ("hal-find-by-property --key system.formfactor.subtype --string tabletpc", >+ NULL, NULL, &status, &error) >+ && 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); >+ >+ } >+ } else { >+ g_warning ("Could not spawn hal-find-by-property: %s\n", error->message); >+ g_error_free (error); >+ } >+ > g_idle_add ((GSourceFunc)popup_dialog_idle, NULL); > > gtk_main (); > >+ kill_xvkbd (); >+ > 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 304399
:
175991
|
176123
|
176214
|
176294
|
176295
|
176296
| 176628 |
182807
|
183888
|
183897