diff --git a/modules/clock/clock-applet.c b/modules/clock/clock-applet.c index 0449ca9f99a72909e06e03fda9759f06cdbd0bfe..22319f5345b9c8b3707dfee8c9c07585fff78d31 100644 --- a/modules/clock/clock-applet.c +++ b/modules/clock/clock-applet.c @@ -307,9 +307,6 @@ position_calendar_popup (ClockApplet *cd) gtk_window_get_size (GTK_WINDOW (cd->calendar_popup), &w, &h); gtk_widget_get_preferred_size (cd->calendar_popup, &req, NULL); - w = req.width; - h = req.height; - gtk_widget_get_allocation (cd->panel_button, &allocation); button_w = allocation.width; button_h = allocation.height; @@ -324,38 +321,32 @@ position_calendar_popup (ClockApplet *cd) switch (gp_applet_get_position (GP_APPLET (cd))) { case GTK_POS_LEFT: x += button_w; - if ((y + h) > monitor.y + monitor.height) - y -= (y + h) - (monitor.y + monitor.height); + if ((y + req.height) > monitor.y + monitor.height) + y -= (y + req.height) - (monitor.y + monitor.height); - if ((y + h) > (monitor.height / 2)) - gravity = GDK_GRAVITY_SOUTH_WEST; - else - gravity = GDK_GRAVITY_NORTH_WEST; + gravity = GDK_GRAVITY_NORTH_WEST; break; case GTK_POS_RIGHT: x -= w; - if ((y + h) > monitor.y + monitor.height) - y -= (y + h) - (monitor.y + monitor.height); + if ((y + req.height) > monitor.y + monitor.height) + y -= (y + req.height) - (monitor.y + monitor.height); - if ((y + h) > (monitor.height / 2)) - gravity = GDK_GRAVITY_SOUTH_EAST; - else - gravity = GDK_GRAVITY_NORTH_EAST; + gravity = GDK_GRAVITY_NORTH_EAST; break; case GTK_POS_TOP: y += button_h; - if ((x + w) > monitor.x + monitor.width) - x -= (x + w) - (monitor.x + monitor.width); + if ((x + req.width) > monitor.x + monitor.width) + x -= (x + req.width) - (monitor.x + monitor.width); gravity = GDK_GRAVITY_NORTH_WEST; break; case GTK_POS_BOTTOM: y -= h; - if ((x + w) > monitor.x + monitor.width) - x -= (x + w) - (monitor.x + monitor.width); + if ((x + req.width) > monitor.x + monitor.width) + x -= (x + req.width) - (monitor.x + monitor.width); gravity = GDK_GRAVITY_SOUTH_WEST;