diff options
author | Javier <dev.git@javispedro.com> | 2015-01-25 21:41:03 +0100 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2015-01-25 21:41:03 +0100 |
commit | 9d610195bfaf1e51c713a8438c188bea032e4573 (patch) | |
tree | c8ca31aeae6bdd11eaebec43b311de106b3649e9 | |
parent | f12470d28538aefcbefb89e1aea5e4f8aa455af7 (diff) | |
download | mdock-9d610195bfaf1e51c713a8438c188bea032e4573.tar.gz mdock-9d610195bfaf1e51c713a8438c188bea032e4573.zip |
add some margin to monitor edges
-rw-r--r-- | libmdock/mdock-widget.c | 9 |
1 files 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 <zeitgeist.h> #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); |