- if (self->submenu->size.width + x >= a->x + a->width)
- x = self->parent->location.x - self->submenu->size.width -
- ob_rr_theme->bwidth + ob_rr_theme->menu_overlap;
+ if (self->submenu->size.width + x >= a->x + a->width) {
+ int newparentx = a->x + a->width
+ - self->submenu->size.width
+ - self->parent->size.width
+ - ob_rr_theme->bwidth
+ - ob_rr_theme->menu_overlap;
+
+ x = a->x + a->width - self->submenu->size.width
+ - ob_rr_theme->menu_overlap;
+ XWarpPointer(ob_display, None, None, 0, 0, 0, 0,
+ newparentx - self->parent->location.x, 0);
+
+ menu_show_full(self->parent, newparentx,
+ self->parent->location.y, self->parent->client);
+ }