~ubuntu-branches/ubuntu/vivid/cairo-dock-plug-ins/vivid

« back to all changes in this revision

Viewing changes to Scooby-Do/src/applet-session.c

  • Committer: Matthieu Baerts
  • Date: 2013-08-27 14:46:47 UTC
  • mto: (53.1.4 cairo-dock-plug-ins)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: matttbe@gmail.com-20130827144647-wm0kyawa8vcg0cso
Tags: upstream-3.2.99.beta1.1~20130827~bzr2928
ImportĀ upstreamĀ versionĀ 3.2.99.beta1.1~20130827~bzr2928

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <stdlib.h>
21
21
#include <string.h>
22
22
 
23
 
#include <gdk/gdkx.h>
 
23
#include <gdk/gdkx.h>  // gldi_container_present
24
24
 
25
25
#include "applet-struct.h"
26
26
#include "applet-search.h"
41
41
        // register to draw on dock.
42
42
        if (cd_do_session_is_off ())
43
43
        {
44
 
                cairo_dock_register_notification_on_object (g_pMainDock,
 
44
                gldi_object_register_notification (g_pMainDock,
45
45
                        NOTIFICATION_UPDATE,
46
 
                        (CairoDockNotificationFunc) cd_do_update_container,
47
 
                        CAIRO_DOCK_RUN_AFTER, NULL);
48
 
                cairo_dock_register_notification_on_object (g_pMainDock,
 
46
                        (GldiNotificationFunc) cd_do_update_container,
 
47
                        GLDI_RUN_AFTER, NULL);
 
48
                gldi_object_register_notification (g_pMainDock,
49
49
                        NOTIFICATION_RENDER,
50
 
                        (CairoDockNotificationFunc) cd_do_render,
51
 
                        CAIRO_DOCK_RUN_AFTER, NULL);
 
50
                        (GldiNotificationFunc) cd_do_render,
 
51
                        GLDI_RUN_AFTER, NULL);
52
52
        }
53
53
        
54
54
        // wait for keyboard input.
55
 
        cairo_dock_register_notification_on_object (&myContainersMgr,
 
55
        gldi_object_register_notification (&myContainerObjectMgr,
56
56
                NOTIFICATION_KEY_PRESSED,
57
 
                (CairoDockNotificationFunc) cd_do_key_pressed,
58
 
                CAIRO_DOCK_RUN_AFTER, NULL);
59
 
        cairo_dock_register_notification_on_object (&myDesktopMgr,
 
57
                (GldiNotificationFunc) cd_do_key_pressed,
 
58
                GLDI_RUN_AFTER, NULL);
 
59
        gldi_object_register_notification (&myWindowObjectMgr,
60
60
                NOTIFICATION_WINDOW_ACTIVATED,
61
 
                (CairoDockNotificationFunc) cd_do_check_active_dock,
62
 
                CAIRO_DOCK_RUN_AFTER, NULL);
 
61
                (GldiNotificationFunc) cd_do_check_active_dock,
 
62
                GLDI_RUN_AFTER, NULL);
63
63
        
64
64
        myData.sCurrentText = g_string_sized_new (20);
65
65
        myConfig.labelDescription.iSize = myConfig.fFontSizeRatio * g_pMainDock->iMaxDockHeight;
79
79
        cairo_dock_emit_enter_signal (CAIRO_CONTAINER (g_pMainDock));
80
80
        
81
81
        // le main dock prend le focus.
82
 
        myData.iPreviouslyActiveWindow = cairo_dock_get_active_xwindow ();
83
 
        //if (cairo_dock_get_desklet_by_Xid (myData.iPreviouslyActiveWindow))
84
 
        //      myData.iPreviouslyActiveWindow = 0;
85
 
        ///gtk_window_present (GTK_WINDOW (g_pMainDock->container.pWidget));
86
 
        gtk_window_present_with_time (GTK_WINDOW (g_pMainDock->container.pWidget), gdk_x11_get_server_time (gldi_container_get_gdk_window(CAIRO_CONTAINER (g_pMainDock))));  // pour eviter la prevention du vol de focus.
 
82
        gldi_container_present (CAIRO_CONTAINER (g_pMainDock));
87
83
        cairo_dock_freeze_docks (TRUE);
88
84
        
89
85
        // On lance l'animation d'attente.
98
94
                return;
99
95
        
100
96
        // no more keyboard input.
101
 
        cairo_dock_remove_notification_func_on_object (&myContainersMgr,
 
97
        gldi_object_remove_notification (&myContainerObjectMgr,
102
98
                NOTIFICATION_KEY_PRESSED,
103
 
                (CairoDockNotificationFunc) cd_do_key_pressed, NULL);
104
 
        cairo_dock_remove_notification_func_on_object (&myDesktopMgr,
 
99
                (GldiNotificationFunc) cd_do_key_pressed, NULL);
 
100
        gldi_object_remove_notification (&myWindowObjectMgr,
105
101
                NOTIFICATION_WINDOW_ACTIVATED,
106
 
                (CairoDockNotificationFunc) cd_do_check_active_dock, NULL);
 
102
                (GldiNotificationFunc) cd_do_check_active_dock, NULL);
107
103
        
108
104
        g_string_free (myData.sCurrentText, TRUE);
109
105
        myData.sCurrentText = NULL;
118
114
        
119
115
        cairo_dock_emit_leave_signal (CAIRO_CONTAINER (g_pMainDock));
120
116
        
121
 
        // on redonne le focus a l'ancienne fenetre.
122
 
        if (myData.iPreviouslyActiveWindow != 0)
123
 
        {
124
 
                /// ne le faire que si on a encore le focus, sinon c'est que l'utilisateur a change lui-meme de fenetre...
125
 
                //Window iActiveWindow = cairo_dock_get_active_xwindow ();
126
 
                
127
 
                //cairo_dock_show_xwindow (myData.iPreviouslyActiveWindow);
128
 
                myData.iPreviouslyActiveWindow = 0;
129
 
        }
130
 
        
131
117
        // on quitte dans une animation.
132
118
        myData.iCloseTime = myConfig.iCloseDuration;
133
119
        cairo_dock_launch_animation (CAIRO_CONTAINER (g_pMainDock));
146
132
        
147
133
        myData.iCloseTime = 0;
148
134
        
149
 
        cairo_dock_remove_notification_func_on_object (g_pMainDock, NOTIFICATION_RENDER, (CairoDockNotificationFunc) cd_do_render, NULL);
150
 
        cairo_dock_remove_notification_func_on_object (g_pMainDock, NOTIFICATION_UPDATE, (CairoDockNotificationFunc) cd_do_update_container, NULL);
 
135
        gldi_object_remove_notification (g_pMainDock, NOTIFICATION_RENDER, (GldiNotificationFunc) cd_do_render, NULL);
 
136
        gldi_object_remove_notification (g_pMainDock, NOTIFICATION_UPDATE, (GldiNotificationFunc) cd_do_update_container, NULL);
151
137
        
152
138
        /// arreter les backends...
153
139