From 9d610195bfaf1e51c713a8438c188bea032e4573 Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 25 Jan 2015 21:41:03 +0100 Subject: add some margin to monitor edges --- libmdock/mdock-widget.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libmdock/mdock-widget.c b/libmdock/mdock-widget.c index d7cafd7..b202f8a 100644 --- a/libmdock/mdock-widget.c +++ b/libmdock/mdock-widget.c @@ -33,6 +33,7 @@ #include #endif +#define POPUP_MONITOR_EDGE_MARGIN 8 #define POPUP_MOVE_TIMEOUT 100 #define POPUP_SHOW_TIMEOUT 200 #define POPUP_HIDE_TIMEOUT 500 @@ -174,14 +175,14 @@ static void show_item_popup(MDockWidget *self, MDockItem *item) if (x + requisition.width > monitor.x + monitor.width) { x -= x - (monitor.x + monitor.width) + requisition.width; - } else if (x < monitor.x) { - x = monitor.x; + } else if (x < monitor.x + POPUP_MONITOR_EDGE_MARGIN) { + x = monitor.x + POPUP_MONITOR_EDGE_MARGIN; } if (y + requisition.height > monitor.y + monitor.height) { y -= y - (monitor.y + monitor.height) + requisition.height; - } else if (y < monitor.y) { - y = monitor.y; + } else if (y < monitor.y + POPUP_MONITOR_EDGE_MARGIN) { + y = monitor.y + POPUP_MONITOR_EDGE_MARGIN; } gtk_window_move(GTK_WINDOW(selector), x, y); -- cgit v1.2.3