The main menu probably had a chance to popup in a wrong place in some cases
This commit is contained in:
parent
c9c02fe5df
commit
77f134ec59
14
src/panel.c
14
src/panel.c
|
@ -32,6 +32,8 @@
|
||||||
/* types */
|
/* types */
|
||||||
struct _Panel
|
struct _Panel
|
||||||
{
|
{
|
||||||
|
gint height;
|
||||||
|
|
||||||
gint icon_width;
|
gint icon_width;
|
||||||
gint icon_height;
|
gint icon_height;
|
||||||
|
|
||||||
|
@ -119,16 +121,16 @@ Panel * panel_new(PanelPrefs * prefs)
|
||||||
/* panel */
|
/* panel */
|
||||||
g_idle_add(_on_idle, panel);
|
g_idle_add(_on_idle, panel);
|
||||||
panel->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
panel->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||||
rect.height = panel->icon_height + (PANEL_BORDER_WIDTH * 8);
|
panel->height = panel->icon_height + (PANEL_BORDER_WIDTH * 8);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "DEBUG: %s() height=%d\n", __func__, rect.height);
|
fprintf(stderr, "DEBUG: %s() height=%d\n", __func__, panel->height);
|
||||||
#endif
|
#endif
|
||||||
gtk_window_resize(GTK_WINDOW(panel->window), panel->root_width,
|
gtk_window_resize(GTK_WINDOW(panel->window), panel->root_width,
|
||||||
rect.height);
|
panel->height);
|
||||||
gtk_window_set_type_hint(GTK_WINDOW(panel->window),
|
gtk_window_set_type_hint(GTK_WINDOW(panel->window),
|
||||||
GDK_WINDOW_TYPE_HINT_DOCK);
|
GDK_WINDOW_TYPE_HINT_DOCK);
|
||||||
gtk_window_move(GTK_WINDOW(panel->window), rect.x,
|
gtk_window_move(GTK_WINDOW(panel->window), rect.x,
|
||||||
rect.y + panel->root_height - rect.height);
|
rect.y + panel->root_height - panel->height);
|
||||||
gtk_window_stick(GTK_WINDOW(panel->window));
|
gtk_window_stick(GTK_WINDOW(panel->window));
|
||||||
g_signal_connect(G_OBJECT(panel->window), "delete-event", G_CALLBACK(
|
g_signal_connect(G_OBJECT(panel->window), "delete-event", G_CALLBACK(
|
||||||
_on_closex), panel);
|
_on_closex), panel);
|
||||||
|
@ -299,7 +301,6 @@ static void _panel_helper_position_menu(GtkMenu * menu, gint * x, gint * y,
|
||||||
{
|
{
|
||||||
Panel * panel = data;
|
Panel * panel = data;
|
||||||
GtkRequisition req;
|
GtkRequisition req;
|
||||||
gint height;
|
|
||||||
|
|
||||||
gtk_widget_size_request(GTK_WIDGET(menu), &req);
|
gtk_widget_size_request(GTK_WIDGET(menu), &req);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -309,8 +310,7 @@ static void _panel_helper_position_menu(GtkMenu * menu, gint * x, gint * y,
|
||||||
if(req.height <= 0)
|
if(req.height <= 0)
|
||||||
return;
|
return;
|
||||||
*x = PANEL_BORDER_WIDTH;
|
*x = PANEL_BORDER_WIDTH;
|
||||||
gtk_window_get_size(GTK_WINDOW(panel->window), NULL, &height);
|
*y = panel->root_height - panel->height - req.height;
|
||||||
*y = panel->root_height - height - req.height;
|
|
||||||
*push_in = TRUE;
|
*push_in = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user