]> Dogcows Code - chaz/tint2/commitdiff
launcher : fixed icon position
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Sun, 7 Nov 2010 17:43:14 +0000 (17:43 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Sun, 7 Nov 2010 17:43:14 +0000 (17:43 +0000)
src/launcher/launcher.c
src/launcher/xsettings-client.c
src/systray/systraybar.c

index 0cb9fc88157a800355f2efd73b54cdfbebf89747..cf9e1365ea541d630590c7d491db39688ecbd9b1 100644 (file)
@@ -199,10 +199,7 @@ int resize_launcher(void *obj)
                }
        }
        
-       count = 0;
-       for (l = launcher->list_icons; l ; l = l->next) {
-               count++;
-       }
+       count = g_slist_length(launcher->list_icons);
 
        if (panel_horizontal) {
                if (!count) launcher->area.width = 0;
@@ -228,7 +225,7 @@ int resize_launcher(void *obj)
        }
 
        int i, posx, posy;
-       int start = launcher->area.bg->border.width + launcher->area.paddingy;// +marging/2;
+       int start = launcher->area.bg->border.width + launcher->area.paddingy + marging/2;
        if (panel_horizontal) {
                posy = start;
                posx = launcher->area.bg->border.width + launcher->area.paddingxlr;
@@ -243,6 +240,7 @@ int resize_launcher(void *obj)
                
                launcherIcon->y = posy;
                launcherIcon->x = posx;
+               //printf("launcher %d : %d,%d\n", i, posx, posy);
                if (panel_horizontal) {
                        if (i % icons_per_column)
                                posy += icon_size + launcher->area.paddingx;
index be569e6d2d339aa7597f58782e481ab87af8901e..e888dc989faaa8a1b5ec9d67b14e4fa808462adc 100644 (file)
@@ -412,25 +412,18 @@ XSettingsClient *xsettings_client_new (Display *display, int screen, XSettingsNo
        client->manager_window = None;
        client->settings = NULL;
 
-       XGrabServer (server.dsp);
-       client->manager_window = XGetSelectionOwner (server.dsp, server.atom._XSETTINGS_SCREEN);
-       if (client->manager_window != None)
-               XSelectInput (server.dsp, client->manager_window, PropertyChangeMask | StructureNotifyMask);
-       XUngrabServer (client->display);
-       XFlush (client->display);
-       
-       if (client->manager_window == None) {
-               printf("NO XSETTINGS manager, tint2 use config 'launcher_icon_theme'.\n");
-               free (client);
-               return NULL;
-       }
-
        if (client->watch)
                client->watch (RootWindow (display, screen), True, StructureNotifyMask, client->cb_data);
 
        check_manager_window (client);
 
-       return client;
+       if (client->manager_window == None) {
+               printf("NO XSETTINGS manager, tint2 use config 'launcher_icon_theme'.\n");
+               free (client);
+               return NULL;
+       }
+       else
+               return client;
 }
 
 
index abf633ecb6b4231ab730a6bd185a7dda87f6fe67..c2f437e679d067d3eed61e0684dd720e9da4c30e 100644 (file)
@@ -167,11 +167,10 @@ int resize_systray(void *obj)
 
 void on_change_systray (void *obj)
 {
-       // here, sysbar's position is defined. so we can calculate position of tray icon.
+       // here, systray.area.posx/posy are defined by rendering engine. so we can calculate position of tray icon.
        Systraybar *sysbar = obj;
-       Panel *panel = sysbar->area.panel;
        int i, posx, posy;
-       int start = panel->area.bg->border.width + panel->area.paddingy + systray.area.bg->border.width + systray.area.paddingy +sysbar->marging/2;
+       int start = systray.area.posy + systray.area.bg->border.width + systray.area.paddingy + sysbar->marging/2;
        if (panel_horizontal) {
                posy = start;
                posx = systray.area.posx + systray.area.bg->border.width + systray.area.paddingxlr;
@@ -189,6 +188,7 @@ void on_change_systray (void *obj)
 
                traywin->y = posy;
                traywin->x = posx;
+               //printf("systray %d : %d,%d\n", i, posx, posy);
                traywin->width = sysbar->icon_size;
                traywin->height = sysbar->icon_size;
                if (panel_horizontal) {
This page took 0.028425 seconds and 4 git commands to generate.