This is an automated email from the git hooks/post-receive script. eric pushed a commit to branch master in repository xfce/xfce4-session.
commit de08d36be960b7105c4bd4a3c598c9a43c3c4bfa Author: Eric Koegel <[email protected]> Date: Mon Mar 21 08:53:00 2016 +0300 Start porting xfsm to GTK3 By compiling the GTK2 stuff with GSEAL and DISABLE_DEPRECATED. This way we can port smaller parts of it and test those changes before the massive GTK3 changeset. --- xfce4-session/main.c | 2 +- xfce4-session/xfsm-chooser.c | 5 ++--- xfce4-session/xfsm-compat-gnome.c | 6 +++--- xfce4-session/xfsm-fadeout.c | 4 +++- xfce4-session/xfsm-legacy.c | 30 +++++++++++++++--------------- xfce4-session/xfsm-logout-dialog.c | 14 ++++++++------ xfce4-session/xfsm-manager.c | 10 +++++++++- xfce4-session/xfsm-splash-screen.c | 4 ++-- 8 files changed, 43 insertions(+), 32 deletions(-) diff --git a/xfce4-session/main.c b/xfce4-session/main.c index 0c27a55..8e2aea9 100644 --- a/xfce4-session/main.c +++ b/xfce4-session/main.c @@ -280,7 +280,7 @@ main (int argc, char **argv) /* fake a client id for the manager, so the legacy management does not * recognize us to be a session client. */ - gdk_set_sm_client_id (xfsm_generate_client_id (NULL)); + gdk_x11_set_sm_client_id (xfsm_generate_client_id (NULL)); xfsm_dbus_init (); diff --git a/xfce4-session/xfsm-chooser.c b/xfce4-session/xfsm-chooser.c index 7f7c1e9..9532488 100644 --- a/xfce4-session/xfsm-chooser.c +++ b/xfce4-session/xfsm-chooser.c @@ -148,9 +148,8 @@ xfsm_chooser_init (XfsmChooser *chooser) GtkWidget *swin; GtkWidget *dbox; - dbox = GTK_DIALOG (chooser)->vbox; + dbox = gtk_dialog_get_content_area(GTK_DIALOG (chooser)); - gtk_dialog_set_has_separator (GTK_DIALOG (chooser), FALSE); g_signal_connect_after (G_OBJECT (chooser), "realize", G_CALLBACK (xfsm_chooser_realized), chooser); @@ -233,7 +232,7 @@ xfsm_chooser_realized (GtkWidget *widget, GdkCursor *cursor; cursor = gdk_cursor_new (GDK_LEFT_PTR); - gdk_window_set_cursor (widget->window, cursor); + gdk_window_set_cursor (gtk_widget_get_window(widget), cursor); gdk_cursor_unref (cursor); } diff --git a/xfce4-session/xfsm-compat-gnome.c b/xfce4-session/xfsm-compat-gnome.c index 35e9617..2d0d52d 100644 --- a/xfce4-session/xfsm-compat-gnome.c +++ b/xfce4-session/xfsm-compat-gnome.c @@ -204,7 +204,7 @@ xfsm_compat_gnome_smproxy_startup (void) * This has another advantage, since it prevents people from running * gnome-smproxy in xfce4, which would cause trouble otherwise. */ - dpy = gdk_display; + dpy = gdk_x11_get_default_xdisplay (); root = RootWindow (dpy, 0); if (gnome_smproxy_window != None) @@ -233,8 +233,8 @@ xfsm_compat_gnome_smproxy_shutdown (void) if (gnome_smproxy_window != None) { - XDestroyWindow (gdk_display, gnome_smproxy_window); - XSync (gdk_display, False); + XDestroyWindow (gdk_x11_get_default_xdisplay (), gnome_smproxy_window); + XSync (gdk_x11_get_default_xdisplay (), False); gnome_smproxy_window = None; } diff --git a/xfce4-session/xfsm-fadeout.c b/xfce4-session/xfsm-fadeout.c index 91af5b6..10c60d6 100644 --- a/xfce4-session/xfsm-fadeout.c +++ b/xfce4-session/xfsm-fadeout.c @@ -70,7 +70,9 @@ xfsm_fadeout_new (GdkDisplay *display) gdk_screen = gdk_display_get_screen (display, n); root = gdk_screen_get_root_window (gdk_screen); - gdk_drawable_get_size (GDK_DRAWABLE (root), &width, &height); + + width = gdk_window_get_width (root); + height = gdk_window_get_height (root); attr.width = width; attr.height = height; diff --git a/xfce4-session/xfsm-legacy.c b/xfce4-session/xfsm-legacy.c index 932aeaf..c82dc73 100644 --- a/xfce4-session/xfsm-legacy.c +++ b/xfce4-session/xfsm-legacy.c @@ -200,7 +200,7 @@ has_xsmp_support (Window window) XTextProperty tp; gboolean has_it = FALSE; - if (XGetTextProperty (gdk_display, window, &tp, _XA_SM_CLIENT_ID)) + if (XGetTextProperty (gdk_x11_get_default_xdisplay (), window, &tp, _XA_SM_CLIENT_ID)) { if (tp.encoding == XA_STRING && tp.format == 8 && tp.nitems != 0) has_it = TRUE; @@ -222,7 +222,7 @@ get_wmcommand (Window window) int argc, i; gdk_error_trap_push (); - status = XGetCommand (gdk_display, window, &argv, &argc); + status = XGetCommand (gdk_x11_get_default_xdisplay (), window, &argv, &argc); if (gdk_error_trap_pop ()) return NULL; @@ -246,7 +246,7 @@ get_wmclientmachine (Window window) Status status; gdk_error_trap_push (); - status = XGetWMClientMachine (gdk_display, window, &tp); + status = XGetWMClientMachine (gdk_x11_get_default_xdisplay (), window, &tp); if (gdk_error_trap_pop ()) return NULL; @@ -275,7 +275,7 @@ get_clientleader (Window window) unsigned char *data = 0; Window result = window; - status = XGetWindowProperty (gdk_display, window, _XA_WM_CLIENT_LEADER, + status = XGetWindowProperty (gdk_x11_get_default_xdisplay (), window, _XA_WM_CLIENT_LEADER, 0, 10000, FALSE, XA_WINDOW, &type, &format, &nitems, &extra, &data); if (status == Success) @@ -320,11 +320,11 @@ xfsm_legacy_perform_session_save (void) /* query X atoms */ if (_XA_WM_SAVE_YOURSELF == None) { - _XA_SM_CLIENT_ID = XInternAtom (gdk_display, "SM_CLIENT_ID", False); - _XA_WM_PROTOCOLS = XInternAtom (gdk_display, "WM_PROTOCOLS", False); - _XA_WM_SAVE_YOURSELF = XInternAtom (gdk_display, "WM_SAVE_YOURSELF", + _XA_SM_CLIENT_ID = XInternAtom (gdk_x11_get_default_xdisplay (), "SM_CLIENT_ID", False); + _XA_WM_PROTOCOLS = XInternAtom (gdk_x11_get_default_xdisplay (), "WM_PROTOCOLS", False); + _XA_WM_SAVE_YOURSELF = XInternAtom (gdk_x11_get_default_xdisplay (), "WM_SAVE_YOURSELF", False); - _XA_WM_CLIENT_LEADER = XInternAtom (gdk_display, "WM_CLIENT_LEADER", + _XA_WM_CLIENT_LEADER = XInternAtom (gdk_x11_get_default_xdisplay (), "WM_CLIENT_LEADER", False); } @@ -332,7 +332,7 @@ xfsm_legacy_perform_session_save (void) old_handler = XSetErrorHandler (wins_error_handler); /* query mapped windows on all screens */ - for (n = 0; n < ScreenCount (gdk_display); ++n) + for (n = 0; n < ScreenCount (gdk_x11_get_default_xdisplay ()); ++n) { screen = wnck_screen_get (n); wnck_screen_force_update (screen); @@ -357,7 +357,7 @@ xfsm_legacy_perform_session_save (void) nprotocols = 0; protocols = NULL; - if (XGetWMProtocols (gdk_display, leader, &protocols, &nprotocols)) + if (XGetWMProtocols (gdk_x11_get_default_xdisplay (), leader, &protocols, &nprotocols)) { for (i = 0; i < nprotocols; ++i) if (protocols[i] == _XA_WM_SAVE_YOURSELF) @@ -368,7 +368,7 @@ xfsm_legacy_perform_session_save (void) XFree ((void *) protocols); } - if (XGetClassHint (gdk_display, leader, &class_hint)) + if (XGetClassHint (gdk_x11_get_default_xdisplay (), leader, &class_hint)) { wmclass2 = g_strdup (class_hint.res_class); wmclass1 = g_strdup (class_hint.res_name); @@ -382,8 +382,8 @@ xfsm_legacy_perform_session_save (void) } /* open fresh display for sending WM_SAVE_YOURSELF commands */ - XSync (gdk_display, False); - display = XOpenDisplay (DisplayString (gdk_display)); + XSync (gdk_x11_get_default_xdisplay (), False); + display = XOpenDisplay (DisplayString (gdk_x11_get_default_xdisplay ())); if (display == NULL) { XSetErrorHandler (old_handler); @@ -596,7 +596,7 @@ xfsm_legacy_init (void) Window root; int n; - dpy = gdk_display; + dpy = gdk_x11_get_default_xdisplay (); /* Some CDE apps are broken (thanks again to Craig for the Sun Box :). * Bugfix found on http://bugzilla.gnome.org/long_list.cgi?buglist=81343 @@ -657,7 +657,7 @@ xfsm_legacy_shutdown (void) { sm_window = SM_WINDOW (lp->data); if (sm_window->wid != None) - XKillClient (gdk_display, sm_window->wid); + XKillClient (gdk_x11_get_default_xdisplay (), sm_window->wid); } sm_window_list_clear (); diff --git a/xfce4-session/xfsm-logout-dialog.c b/xfce4-session/xfsm-logout-dialog.c index c86a155..1d98fdd 100644 --- a/xfce4-session/xfsm-logout-dialog.c +++ b/xfce4-session/xfsm-logout-dialog.c @@ -158,7 +158,6 @@ xfsm_logout_dialog_init (XfsmLogoutDialog *dialog) dialog->shutdown = xfsm_shutdown_get (); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL); - gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER); gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); @@ -168,7 +167,7 @@ xfsm_logout_dialog_init (XfsmLogoutDialog *dialog) save_session = xfconf_channel_get_bool (channel, "/general/SaveOnExit", TRUE); main_vbox = gtk_vbox_new (FALSE, BORDER); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), main_vbox, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), main_vbox, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (main_vbox), BORDER); gtk_widget_show (main_vbox); @@ -502,7 +501,10 @@ xfsm_logout_dialog_screenshot_new (GdkScreen *screen) screen_rect.height = gdk_screen_get_height (screen); window = gdk_screen_get_root_window (screen); - gdk_drawable_get_size (GDK_DRAWABLE (window), &rect.width, &rect.height); + + rect.width = gdk_window_get_width (window); + rect.height = gdk_window_get_height (window); + gdk_window_get_origin (window, &x, &y); rect.x = x; @@ -627,7 +629,7 @@ xfsm_logout_dialog_run (GtkDialog *dialog, #ifdef GDK_WINDOWING_X11 /* force input to the dialog */ gdk_error_trap_push (); - XSetInputFocus (GDK_DISPLAY (), + XSetInputFocus (gdk_x11_get_default_xdisplay (), GDK_WINDOW_XWINDOW (window), RevertToParent, CurrentTime); gdk_error_trap_pop (); @@ -725,8 +727,8 @@ xfsm_logout_dialog (const gchar *session_name, xfsm_window_add_border (GTK_WINDOW (dialog)); gtk_widget_realize (dialog); - gdk_window_set_override_redirect (dialog->window, TRUE); - gdk_window_raise (dialog->window); + gdk_window_set_override_redirect (gtk_widget_get_window (dialog), TRUE); + gdk_window_raise (gtk_widget_get_window (dialog)); } else { diff --git a/xfce4-session/xfsm-manager.c b/xfce4-session/xfsm-manager.c index 999e420..d677076 100644 --- a/xfce4-session/xfsm-manager.c +++ b/xfce4-session/xfsm-manager.c @@ -501,8 +501,11 @@ xfsm_manager_choose_session (XfsmManager *manager, { if (G_UNLIKELY (preview_default == NULL)) { + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + /* TODO: Turn this into a normal pixbuf? */ preview_default = gdk_pixbuf_new_from_inline (-1, xfsm_chooser_icon_data, FALSE, NULL); + G_GNUC_END_IGNORE_DEPRECATIONS } session->preview = GDK_PIXBUF (g_object_ref (preview_default)); @@ -803,7 +806,12 @@ xfsm_manager_restart (XfsmManager *manager) /* tell splash screen that the session is starting now */ preview = xfsm_load_session_preview (manager->session_name); if (preview == NULL) - preview = gdk_pixbuf_new_from_inline (-1, xfsm_chooser_icon_data, FALSE, NULL); + { + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + /* TODO: Turn this into a normal pixbuf? */ + preview = gdk_pixbuf_new_from_inline (-1, xfsm_chooser_icon_data, FALSE, NULL); + G_GNUC_END_IGNORE_DEPRECATIONS + } steps = g_queue_get_length (manager->failsafe_mode ? manager->failsafe_clients : manager->pending_properties); xfsm_splash_screen_start (splash_screen, manager->session_name, preview, steps); g_object_unref (preview); diff --git a/xfce4-session/xfsm-splash-screen.c b/xfce4-session/xfsm-splash-screen.c index 89ca5da..9c2b796 100644 --- a/xfce4-session/xfsm-splash-screen.c +++ b/xfce4-session/xfsm-splash-screen.c @@ -222,12 +222,12 @@ again: _("Choose a name for the new session:")); label = gtk_label_new (title); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), label, TRUE, TRUE, 6); gtk_widget_show (label); entry = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), + gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), entry, TRUE, TRUE, 6); gtk_widget_show (entry); -- To stop receiving notification emails like this one, please contact the administrator of this repository. _______________________________________________ Xfce4-commits mailing list [email protected] https://mail.xfce.org/mailman/listinfo/xfce4-commits
