Exemplo n.º 1
0
/** Grab the mouse for resizing a window. */
int GrabMouseForResize(BorderActionType action) {

   Cursor cur;
   int result;

   cur = GetFrameCursor(action);

   result = JXGrabPointer(display, rootWindow, False, ButtonPressMask
      | ButtonReleaseMask | PointerMotionMask, GrabModeAsync,
      GrabModeAsync, None, cur, CurrentTime);

   if(JLIKELY(result == GrabSuccess)) {
      return 1;
   } else {
      return 0;
   }

}
Exemplo n.º 2
0
/** Process an enter notify event. */
void HandleEnterNotify(const XCrossingEvent *event)
{
   ClientNode *np;
   Cursor cur;
   np = FindClient(event->window);
   if(np) {
      if(  !(np->state.status & STAT_ACTIVE)
         && (settings.focusModel == FOCUS_SLOPPY)) {
         FocusClient(np);
      }
      if(np->parent == event->window) {
         np->borderAction = GetBorderActionType(np, event->x, event->y);
         cur = GetFrameCursor(np->borderAction);
         JXDefineCursor(display, np->parent, cur);
      } else if(np->borderAction != BA_NONE) {
         SetDefaultCursor(np->parent);
         np->borderAction = BA_NONE;
      }
   }

}
Exemplo n.º 3
0
/** Handle a motion notify event. */
void HandleMotionNotify(const XMotionEvent *event)
{

   ClientNode *np;
   Cursor cur;

   if(event->is_hint) {
      return;
   }

   np = FindClientByParent(event->window);
   if(np) {
      BorderActionType action;
      action = GetBorderActionType(np, event->x, event->y);
      if(np->borderAction != action) {
         np->borderAction = action;
         cur = GetFrameCursor(action);
         JXDefineCursor(display, np->parent, cur);
      }
   }

}
Exemplo n.º 4
0
/** Handle a motion notify event. */
void HandleMotionNotify(const XMotionEvent *event) {

   ClientNode *np;
   Cursor cur;
   BorderActionType action;

   if(event->is_hint) {
      return;
   }

   SetMousePosition(event->x_root, event->y_root);

   np = FindClientByParent(event->window);
   if(np && (np->state.border & BORDER_OUTLINE)) {
      action = GetBorderActionType(np, event->x, event->y);
      if(np->borderAction != action) {
         np->borderAction = action;
         cur = GetFrameCursor(action);
         JXDefineCursor(display, np->parent, cur);
      }
   }

}