- } else if (be->window == frame.plate) {
- XAllowEvents(display, ReplayPointer, be->time);
- } else if (be->window == frame.title ||
- be->window == frame.label) {
- // shade the window when the titlebar is double clicked
- if ( (be->time - lastButtonPressTime) <=
- openbox.getDoubleClickInterval()) {
- lastButtonPressTime = 0;
- shade();
- } else {
- lastButtonPressTime = be->time;
- }
- // clicking and dragging on the titlebar moves the window, so on a click
- // we need to save the coords of the click in case the user drags
- frame.grab_x = be->x_root - frame.x - frame.border_w;
- frame.grab_y = be->y_root - frame.y - frame.border_w;
- } else if (be->window == frame.handle ||
- be->window == frame.left_grip ||
- be->window == frame.right_grip ||
- be->window == frame.window) {
- // clicking and dragging on the window's frame moves the window, so on a
- // click we need to save the coords of the click in case the user drags
- frame.grab_x = be->x_root - frame.x - frame.border_w;
- frame.grab_y = be->y_root - frame.y - frame.border_w;
- if (be->window == frame.left_grip)
- resize_zone = ZoneBottom | ZoneLeft;
- else if (be->window == frame.right_grip)
- resize_zone = ZoneBottom | ZoneRight;
- }
- // middle click
- } else if (be->state == 0 && be->button == 2) {
- if (be->window == frame.maximize_button) {
- redrawMaximizeButton(True);
- // a middle click anywhere on the window's frame except for on the buttons
- // will lower the window
- } else if (! (be->window == frame.iconify_button ||
- be->window == frame.close_button) ) {
- stack_change = -1;
- }
- // right click
- } else if (be->state == 0 && be->button == 3) {
- if (be->window == frame.maximize_button) {
- redrawMaximizeButton(True);
- // a right click on the window's frame will show or hide the window's
- // windowmenu
- } else if (be->window == frame.title ||
- be->window == frame.label ||
- be->window == frame.handle ||
- be->window == frame.window) {
- int mx, my;
- if (windowmenu) {
- if (windowmenu->isVisible()) {
- windowmenu->hide();
- } else {
- // get the coords for the menu
- mx = be->x_root - windowmenu->getWidth() / 2;
- if (be->window == frame.title || be->window == frame.label) {
- my = frame.y + frame.title_h;
- } else if (be->window = frame.handle) {
- my = frame.y + frame.y_handle - windowmenu->getHeight();
- } else { // (be->window == frame.window)
- if (be->y <= (signed) frame.bevel_w) {
- my = frame.y + frame.y_border;
- } else {
- my = be->y_root - (windowmenu->getHeight() / 2);
- }
- }
-
- if (mx > (signed) (frame.x + frame.width -
- windowmenu->getWidth())) {
- mx = frame.x + frame.width - windowmenu->getWidth();
- } else if (mx < frame.x) {
- mx = frame.x;
- }