~ubuntu-branches/ubuntu/utopic/cairo-dock-plug-ins/utopic-201408192140

« back to all changes in this revision

Viewing changes to keyboard-indicator/src/applet-draw.c

  • Committer: Matthieu Baerts
  • Date: 2014-04-06 23:04:40 UTC
  • mfrom: (1.1.37)
  • Revision ID: matttbe@gmail.com-20140406230440-ho7ktfc4a7vndigu
Tags: 3.3.99.beta1.2.really.3.3.2-0ubuntu1
* Revert back to the 3.3.2 version: (LP: #1302246)
  Unfortunately, due to the lack of time, we have to revert back to the
  latest stable version. Sorry for that but feel free to help us ;-)
* debian/patches: cherry-pick patches from upstream BZR repo, all 'bug-fix'
  and changes that were already in the 3.3.99.beta1 version except all
  changes linked to the new style, the menu and the configuration.
  - bzr3008_GMenu_new_apps_in_the_list.patch: GMenu: New Apps: if there are
    new apps when the 'new apps' dialogue is opened, add these new apps in
    the list
  - bzr3010_GMenu_option_hide_new_apps_dialogue.patch: GMenu: Config: Added
    the possibility to not display notification to quickly launch new apps
  - bzr3021_Terminal_launch_default_terminal_middle_click.patch: Terminal:
    middle click: launch the default terminal
  - bzr3031-3032_GMenu_remove_empty_submenus.patch: GMenu: do not add empty
    submenus when creating them and remove empty submenus
  - bzr3035_DND2Share_History_was_empty.patch: DnD2Share: history menu was
    empty
  - bzr3036-3040_Shortcuts_removed_disk_usage_on_bookmarks_and_support_
    x-nautilus_URI.patch: Shortcuts: correctly removed an old bookmark ;
    added support for x-nautilus-(...) URI ; avoid duplicated code +
    bookmarks doesn't have a disk usage ; translated a few sentences from
    French to English
  - bzr3043_Fixed_typo_with_some_sentences.patch: Fixed typo with some
    sentences which were not correctly translated
  - bzr3045-3046_GVFS_support_x-nautilus-desktop_and_fixed_typos_and_memory_
    leaks.patch: gvfs: fixed typo and tiny memory leak ; GTK3: 'x-nautilus-
    desktop' is just an URI where the root is the path to the desktop
  - bzr3047-3048_Status-Notifier_Added_support_of_middle_click_and_scroll:
    Status-Notifier: IAS (ubuntu): added the support of the middle click ;
    Scroll signals were not catched
  - bzr3051_Logout_Added_support_of_Cinnamon.patch: logout: added support of
    Cinnamon
  - bzr3057_GMenu_new_apps_show_dialog_after_installation.patch: GMenu: new
    apps: show the dialog only after the end of the installation
  - bzr3065_Impulse_do_not_redraw_icon_when_not_needed.patch: Impulse: stop
    animations: do not redraw the icon if it's not needed (e.g. when
    disabling the applet)
  - bzr3067_AlsaMixer_support_cinnamon_settings.patch: AlsaMixer: added the
    support of cinnamon-settings
  - bzr3068_Clock_fixed_a_crash_when_configuring_when_not_enabled.patch:
    Clock: fixed a crash when configuring the applet if it's not activated
  - bzr3069_Indicator_Generic_no_need_to_hide_the_icon_before_removing_it:
    Indicator Generic: stop: no need to hide the icon before removing it
* debian/control: bumped Core versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
        
32
32
        if (bRedrawSurface)  // group has changed -> update the icon and label
33
33
        {
34
 
                if (! cShortGroupName)
35
 
                {
36
 
                        cShortGroupName = myData.cShortGroupName;
37
 
                }
38
 
                else
39
 
                {
40
 
                        g_free (myData.cShortGroupName);
41
 
                        myData.cShortGroupName = g_strdup (cShortGroupName);
42
 
                }
43
 
                if (! cGroupName)
44
 
                {
45
 
                        cGroupName = myData.cGroupName;
46
 
                }
47
 
                else
48
 
                {
49
 
                        g_free (myData.cGroupName);
50
 
                        myData.cGroupName = g_strdup (cGroupName);
51
 
                }
52
 
                
53
34
                //\__________________ On sauvegarde l'ancienne surface/texture.
54
35
                cairo_dock_free_image_buffer (myData.pOldImage);
55
36
                myData.pOldImage = myData.pCurrentImage;
56
37
                myData.pCurrentImage = NULL;
 
38
                /**if (myData.pOldSurface != NULL)
 
39
                        cairo_surface_destroy (myData.pOldSurface);
 
40
                if (myData.pOldImage->iure != 0)
 
41
                        _cairo_dock_delete_texture (myData.pOldImage->iure);
 
42
                myData.pOldSurface = myData.pCurrentSurface;
 
43
                myData.pOldImage->iure = myData.pCurrentImage->iure;
 
44
                myData.pOldImage->iWidth = myData.pCurrentImage->iWidth;
 
45
                myData.pOldImage->iHeight = myData.pCurrentImage->iHeight;*/
57
46
                
58
47
                //\__________________ On cree la nouvelle surface (la taille du texte peut avoir change).
59
48
                int iWidth, iHeight;
60
49
                CD_APPLET_GET_MY_ICON_EXTENT (&iWidth, &iHeight);
61
50
                if (iWidth <= 1 && iHeight <= 1)  // peut arriver au lancement en mode desklet.
62
51
                {
 
52
                        /**myData.pCurrentSurface = NULL;
 
53
                        myData.pCurrentImage->iure = 0;
 
54
                        myData.pCurrentImage->iWidth = 0;
 
55
                        myData.pCurrentImage->iHeight = 0;*/
63
56
                        return;
64
57
                }
65
58
                int w, h;
70
63
                        &w, &h);
71
64
                myData.pCurrentImage = g_new0 (CairoDockImageBuffer, 1);
72
65
                cairo_dock_load_image_buffer_from_surface (myData.pCurrentImage, pSurface, w, h);
 
66
                /**myData.pCurrentSurface = cairo_dock_create_surface_from_text_full (cShortGroupName,
 
67
                        &myConfig.textDescription,
 
68
                        1.,
 
69
                        0*iWidth,
 
70
                        &myData.pCurrentImage->iWidth, &myData.pCurrentImage->iHeight);
 
71
                cd_debug ("KEYBOARD: %dx%d / %dx%d", myData.pCurrentImage->iWidth, myData.pCurrentImage->iHeight, myIcon->image.iWidth, myIcon->image.iHeight);
 
72
                if (g_bUseOpenGL)
 
73
                {
 
74
                        myData.pCurrentImage->iure = cairo_dock_create_texture_from_surface (myData.pCurrentSurface);
 
75
                }*/
73
76
                
74
77
                //\__________________ On lance une transition entre ancienne et nouvelle surface/texture, ou on dessine direct.
75
78
                if (myConfig.iTransitionDuration != 0 && myData.pOldImage != NULL)
91
94
                        else
92
95
                        {
93
96
                                cd_xkbd_render_step_cairo (myIcon, myApplet);
 
97
                                ///CD_APPLET_UPDATE_REFLECT_ON_MY_ICON;
94
98
                        }
95
99
                        CD_APPLET_REDRAW_MY_ICON;
96
100
                }