Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "moved" option for the group settings #235

Closed
rdnvndr opened this issue Oct 22, 2015 · 5 comments
Closed

The "moved" option for the group settings #235

rdnvndr opened this issue Oct 22, 2015 · 5 comments

Comments

@rdnvndr
Copy link
Contributor

rdnvndr commented Oct 22, 2015

Please add "moved" option for the group settings. The "moved" option allows you to move a window by dragging and dropping.
The patch file:

diff -cr jwm/src/client.h jwm-master/src/client.h
*** jwm/src/client.h    2014-11-09 20:17:19.100152348 +0300
--- jwm-master/src/client.h 2014-11-09 21:18:07.870242355 +0300
***************
*** 79,84 ****
--- 79,85 ----
  #define STAT_NOPAGER    (1 << 21)   /**< Don't show in pager. */
  #define STAT_SHAPED     (1 << 22)   /**< This window is shaped. */
  #define STAT_FLASH      (1 << 23)   /**< Flashing for urgency. */
+ #define STAT_MOVED      (1 << 24)   /**< This client is moved. */

  /** Maximization flags. */
  typedef unsigned char MaxFlags;
diff -cr jwm/src/event.c jwm-master/src/event.c
*** jwm/src/event.c 2014-11-09 20:17:19.103485682 +0300
--- jwm-master/src/event.c  2014-11-09 21:20:53.173579766 +0300
***************
*** 370,376 ****
           case Button2:
              FocusClient(np);
              RaiseClient(np);
!             if(mask == Mod1Mask) {
                 GetBorderSize(&np->state, &north, &south, &east, &west);
                 MoveClient(np, event->x + west, event->y + north);
              }
--- 370,376 ----
           case Button2:
              FocusClient(np);
              RaiseClient(np);
!             if((mask == Mod1Mask) || (np->state.status & STAT_MOVED)) {
                 GetBorderSize(&np->state, &north, &south, &east, &west);
                 MoveClient(np, event->x + west, event->y + north);
              }
diff -cr jwm/src/group.c jwm-master/src/group.c
*** jwm/src/group.c 2014-11-09 20:17:19.116819016 +0300
--- jwm-master/src/group.c  2014-11-09 21:22:53.806916075 +0300
***************
*** 263,268 ****
--- 263,271 ----
        case OPTION_PIGNORE:
           np->state.status |= STAT_PIGNORE;
           break;
+       case OPTION_MOVED:
+          np->state.status |= STAT_MOVED;
+          break;
        case OPTION_IIGNORE:
           np->state.status |= STAT_IIGNORE;
           break;
diff -cr jwm/src/group.h jwm-master/src/group.h
*** jwm/src/group.h 2014-11-09 20:17:19.103485682 +0300
--- jwm-master/src/group.h  2014-11-09 21:23:45.603584019 +0300
***************
*** 47,52 ****
--- 47,53 ----
  #define OPTION_NOMOVE         29    /**< Disallow moving. */
  #define OPTION_NORESIZE       30    /**< Disallow resizing. */
  #define OPTION_NOFULLSCREEN   31    /**< Disallow fullscreen. */
+ #define OPTION_MOVED          32    /**< Start moved. */

  /*@{*/
  #define InitializeGroups() (void)(0)

diff -cr jwm/src/parse.c jwm-master/src/parse.c
*** jwm/src/parse.c 2014-11-09 20:17:19.106819016 +0300
--- jwm-master/src/parse.c  2014-11-09 21:24:41.080252055 +0300
***************
*** 91,96 ****
--- 91,97 ----
     { "iignore",            OPTION_IIGNORE       },
     { "maximized",          OPTION_MAXIMIZED     },
     { "minimized",          OPTION_MINIMIZED     },
+    { "moved",              OPTION_MOVED         },
     { "noborder",           OPTION_NOBORDER      },
     { "noclose",            OPTION_NOCLOSE       },
     { "nofocus",            OPTION_NOFOCUS       },

@rdnvndr
Copy link
Contributor Author

rdnvndr commented Nov 21, 2015

Example of use :

<Group>
      <Class>MPlayer</Class>
      <Option>notitle</Option>
      <Option>moved</Option>
</Group>

@joewing
Copy link
Owner

joewing commented Nov 22, 2015

I like this option. It would be useful for things like xclock that don't take mouse input. I've been trying to think of a more descriptive name for the option, though. "moved", "move", "drag", "dragtomove", ... others?
I've also been trying to come up with a way for JWM to recognize that a window doesn't respond to mouse input and just do this automatically, which might more more work than it's worth.

@rdnvndr
Copy link
Contributor Author

rdnvndr commented Nov 22, 2015

Not mind. My English is poor.

@rdnvndr
Copy link
Contributor Author

rdnvndr commented Nov 22, 2015

if you come up with how to determine that the window is not responded events from the mouse it would be very good

@joewing
Copy link
Owner

joewing commented Nov 22, 2015

This is available as of snapshot 1350. I named it "drag". I'm still not sure I like the name, but I haven't been able to come up something I like better.

@joewing joewing closed this as completed Nov 22, 2015
@joewing joewing modified the milestone: Version 2.3.4 Nov 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants