diff options
Diffstat (limited to 'src/Slit.cc')
-rw-r--r-- | src/Slit.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/Slit.cc b/src/Slit.cc index f0a37c7..45ec396 100644 --- a/src/Slit.cc +++ b/src/Slit.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: Slit.cc,v 1.11 2002/04/08 18:58:27 fluxgen Exp $ | 22 | // $Id: Slit.cc,v 1.12 2002/04/08 22:26:58 fluxgen Exp $ |
23 | 23 | ||
24 | //use GNU extensions | 24 | //use GNU extensions |
25 | #ifndef _GNU_SOURCE | 25 | #ifndef _GNU_SOURCE |
@@ -567,20 +567,18 @@ void Slit::buttonPressEvent(XButtonEvent *e) { | |||
567 | XLowerWindow(display, frame.window); | 567 | XLowerWindow(display, frame.window); |
568 | } else if (e->button == Button3) { | 568 | } else if (e->button == Button3) { |
569 | if (! slitmenu.isVisible()) { | 569 | if (! slitmenu.isVisible()) { |
570 | int x, y; | 570 | int x = e->x_root - (slitmenu.width() / 2), |
571 | 571 | y = e->y_root - (slitmenu.height() / 2); | |
572 | x = e->x_root - (slitmenu.getWidth() / 2); | ||
573 | y = e->y_root - (slitmenu.getHeight() / 2); | ||
574 | 572 | ||
575 | if (x < 0) | 573 | if (x < 0) |
576 | x = 0; | 574 | x = 0; |
577 | else if (x + slitmenu.getWidth() > screen->getWidth()) | 575 | else if (x + slitmenu.width() > screen->getWidth()) |
578 | x = screen->getWidth() - slitmenu.getWidth(); | 576 | x = screen->getWidth() - slitmenu.width(); |
579 | 577 | ||
580 | if (y < 0) | 578 | if (y < 0) |
581 | y = 0; | 579 | y = 0; |
582 | else if (y + slitmenu.getHeight() > screen->getHeight()) | 580 | else if (y + slitmenu.height() > screen->getHeight()) |
583 | y = screen->getHeight() - slitmenu.getHeight(); | 581 | y = screen->getHeight() - slitmenu.height(); |
584 | 582 | ||
585 | slitmenu.move(x, y); | 583 | slitmenu.move(x, y); |
586 | slitmenu.show(); | 584 | slitmenu.show(); |