Advertisement
sparkslabs

Add position handling to Xdefaults

Sep 28th, 2024
353
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.46 KB | None | 0 0
  1. diff --git a/oneko.c b/oneko.c
  2. index 48c5bda..7ab4e51 100644
  3. --- a/oneko.c
  4. +++ b/oneko.c
  5. @@ -78,6 +78,7 @@ int   ToWindow = NOTDEFINED;          /*   towindow   */
  6.  int    ToFocus = NOTDEFINED;           /*   tofocus    */
  7.  int     XOffset=0,YOffset=0;            /* X and Y offsets for cat from mouse
  8.                                            pointer. */
  9. +int    position_set = NOTDEFINED;
  10.  /*
  11.   *     @$$$m$$$m$J>uBVJQ?t
  12.   */
  13. @@ -342,6 +343,7 @@ void GetResources()
  14.    char *resource;
  15.    int          num;
  16.    int loop;
  17. +  int    result,foo,bar;
  18.    if (Foreground == NULL) {
  19.      if ((resource = NekoGetDefault("foreground")) != NULL) {
  20.        Foreground = resource;
  21. @@ -386,6 +388,13 @@ void GetResources()
  22.        }
  23.    }
  24.  
  25. +  if (position_set == NOTDEFINED) {
  26. +    if ((resource = NekoGetDefault("position")) != NULL) { // BACKHERE
  27. +      result=XParseGeometry(resource,&XOffset,&YOffset,&foo,&bar);
  28. +    }
  29. +    position_set = 1; // Set this either way
  30. +  }
  31. +
  32.    if (NoShape == NOTDEFINED) {
  33.      if ((resource = NekoGetDefault("noshape")) != NULL) {
  34.        NoShape = IsTrue(resource);
  35. @@ -1514,6 +1523,7 @@ GetArguments(argc, argv, theDisplayName)
  36.      else if (strcmp(argv[ArgCounter], "-position") == 0) {
  37.        ArgCounter++;
  38.        result=XParseGeometry(argv[ArgCounter],&XOffset,&YOffset,&foo,&bar);
  39. +      position_set = 1; // So that we don't try to set it
  40.      }
  41.      else if (strcmp(argv[ArgCounter], "-debug") ==0) {
  42.        Synchronous = True;
  43.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement