home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sources / x / 418 < prev    next >
Encoding:
Text File  |  1992-07-22  |  50.5 KB  |  1,772 lines

  1. Newsgroups: comp.sources.x
  2. Path: sparky!uunet!darwin.sura.net!mips!msi!dcmartin
  3. From: sdo@soliado.East.Sun.COM (Scott Oaks - Sun Consulting NYC)
  4. Subject: v18i050: olvwm 3.0, Patch2, Part03/04
  5. Message-ID: <1992Jul22.152842.19295@msi.com>
  6. Originator: dcmartin@fascet
  7. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  8. Organization: Molecular Simulations, Inc.
  9. References: <csx-18i048-olvwm-3.0@uunet.UU.NET>
  10. Date: Wed, 22 Jul 1992 15:28:42 GMT
  11. Approved: dcmartin@msi.com
  12. Lines: 1758
  13.  
  14. Submitted-by: sdo@soliado.East.Sun.COM (Scott Oaks - Sun Consulting NYC)
  15. Posting-number: Volume 18, Issue 50
  16. Archive-name: olvwm-3.0/patch2.03
  17. Patch-To: olvwm-3.0: Volume 15, Issue 167
  18.  
  19. #!/bin/sh
  20. # this is part.03 (part 3 of a multipart archive)
  21. # do not concatenate these parts, unpack them in order with /bin/sh
  22. # file olvwm3.Patch02 continued
  23. #
  24. if test ! -r _shar_seq_.tmp; then
  25.     echo 'Please unpack part 1 first!'
  26.     exit 1
  27. fi
  28. (read Scheck
  29.  if test "$Scheck" != 3; then
  30.     echo Please unpack part "$Scheck" next!
  31.     exit 1
  32.  else
  33.     exit 0
  34.  fi
  35. ) < _shar_seq_.tmp || exit 1
  36. if test ! -f _shar_wnt_.tmp; then
  37.     echo 'x - still skipping olvwm3.Patch02'
  38. else
  39. echo 'x - continuing file olvwm3.Patch02'
  40. sed 's/^X//' << 'SHAR_EOF' >> 'olvwm3.Patch02' &&
  41. ***************
  42. *** 880,886 ****
  43. --- 1013,1023 ----
  44. X      menu->btnPerCol = 0;
  45. X      menu->maxLabWidth = 0;
  46. X      menu->prefColSize = columns;
  47. +     findClient_rootid = winInfo->core.client->screen;
  48. X      ListApply(ActiveClientList, addButton, menu);
  49. +     if (GRV.VirtualMenuSort == SortAlpha)
  50. +         qsort(menu->buttons, menu->buttonCount, sizeof(Button *), cmpButton);
  51. X  
  52. X      menuInfo->buttons[bindex].subMenu =
  53. X              MenuInfoCreate(cache, winInfo, menu, depth);
  54. *** BUILD/olwm.c    Sat Jun 13 15:50:21 1992
  55. --- src/olwm.c    Sat Jun 13 15:43:26 1992
  56. ***************
  57. *** 4,10 ****
  58. X   *      file for terms of the license.
  59. X   */
  60. X  
  61. ! #ident    "@(#)olwm.c    1.1 olvwm version 1/3/92"
  62. X  
  63. X  /*
  64. X   * Based on
  65. --- 4,10 ----
  66. X   *      file for terms of the license.
  67. X   */
  68. X  
  69. ! #ident    "@(#)olwm.c    1.2 olvwm version 6/13/92"
  70. X  
  71. X  /*
  72. X   * Based on
  73. ***************
  74. *** 196,202 ****
  75. X      char **argv;
  76. X  {
  77. X      int            ErrorHandler();
  78. !     int            ExitOLWM();
  79. X      XrmDatabase        commandlineDB = NULL;
  80. X      char            *dpystr;
  81. X  
  82. --- 196,202 ----
  83. X      char **argv;
  84. X  {
  85. X      int            ErrorHandler();
  86. !     int            ExitOLWM(), RestartOLWM();
  87. X      XrmDatabase        commandlineDB = NULL;
  88. X      char            *dpystr;
  89. X  
  90. ***************
  91. *** 264,269 ****
  92. --- 264,270 ----
  93. X      signal(SIGINT, (VoidFunc)ExitOLWM);
  94. X      signal(SIGTERM, (VoidFunc)ExitOLWM);
  95. X      signal(SIGCHLD, HandleChildSignal);
  96. +     signal(SIGUSR1, RestartOLWM);
  97. X  
  98. X      /* initialize the resource manager */
  99. X      XrmInitialize();
  100. ***************
  101. *** 434,444 ****
  102. X      /* check to see if there are any arguments left unparsed */
  103. X      if ( *argc != 1 )
  104. X      {
  105. X          /* check to see if it's -help */
  106. X          if ( argv[1][0] == '-' && argv[1][1] == 'h' )
  107. X              usage(gettext("Command line arguments accepted"),gettext("are:"));
  108. X          else
  109. !             usage(gettext("Unknown argument(s)"), gettext("encountered"));
  110. X      }
  111. X  }
  112. X  
  113. --- 435,451 ----
  114. X      /* check to see if there are any arguments left unparsed */
  115. X      if ( *argc != 1 )
  116. X      {
  117. +     
  118. +         if (!strcmp(argv[1], "-allowSynthetic"))
  119. +                 GRV.AllowSyntheticEvents = True;
  120. +         else {
  121. +         GRV.AllowSyntheticEvents = False;
  122. X          /* check to see if it's -help */
  123. X          if ( argv[1][0] == '-' && argv[1][1] == 'h' )
  124. X              usage(gettext("Command line arguments accepted"),gettext("are:"));
  125. X          else
  126. !              usage(gettext("Unknown argument(s)"), gettext("encountered"));
  127. !         }
  128. X      }
  129. X  }
  130. X  
  131. *** BUILD/olwm.h    Sat Jun 13 15:50:01 1992
  132. --- src/olwm.h    Sat Jun 13 15:43:26 1992
  133. ***************
  134. *** 133,138 ****
  135. --- 133,139 ----
  136. X  extern void IconShow();
  137. X  extern void IconHide();
  138. X  extern void IconSetPos();
  139. + extern void IconUnparent();
  140. X  
  141. X  /* icon pane functions */
  142. X  extern struct _winiconpane *MakeIconPane();
  143. *** BUILD/parse.l    Sat Jun 13 15:51:04 1992
  144. --- src/parse.l    Sat Jun 13 15:43:26 1992
  145. ***************
  146. *** 4,15 ****
  147. X   *      See LEGAL_NOTICE file for terms of the license.
  148. X   */
  149. X  
  150. ! #ident  "@(#)parse.l    1.2 olvwm version 1/27/92"
  151. X  %}
  152. X  %%
  153. X  
  154. X  Warp    { yylval.ival = Warp; return WARP; }
  155. X  Open    { yylval.ival = Open; return OPEN; }
  156. X  Raise    { yylval.ival = Raise; return RAISE; }
  157. X  Execute    { yylval.ival = Execute; return EXECUTE; }
  158. X  Goto    { yylval.ival = Goto; return GOTO; }
  159. --- 4,17 ----
  160. X   *      See LEGAL_NOTICE file for terms of the license.
  161. X   */
  162. X  
  163. ! #ident  "@(#)parse.l    1.3 olvwm version 6/13/92"
  164. X  %}
  165. X  %%
  166. X  
  167. X  Warp    { yylval.ival = Warp; return WARP; }
  168. X  Open    { yylval.ival = Open; return OPEN; }
  169. + RaiseLower { yylval.ival = RaiseLower; return RAISELOWER; }
  170. + Lower    { yylval.ival = Lower; return LOWER; }
  171. X  Raise    { yylval.ival = Raise; return RAISE; }
  172. X  Execute    { yylval.ival = Execute; return EXECUTE; }
  173. X  Goto    { yylval.ival = Goto; return GOTO; }
  174. *** BUILD/resources.c    Sat Jun 13 15:51:05 1992
  175. --- src/resources.c    Sat Jun 13 15:43:27 1992
  176. ***************
  177. *** 4,10 ****
  178. X   *      file for terms of the license.
  179. X   */
  180. X  
  181. ! #ident "@(#)resources.c    1.2 olvwm version 1/27/92"
  182. X  
  183. X  /*
  184. X   *
  185. --- 4,10 ----
  186. X   *      file for terms of the license.
  187. X   */
  188. X  
  189. ! #ident "@(#)resources.c    1.3 olvwm version 6/13/92"
  190. X  
  191. X  /*
  192. X   *
  193. ***************
  194. *** 60,65 ****
  195. --- 60,67 ----
  196. X  static Bool cvtStringList();
  197. X  static Bool cvtGridEnum();
  198. X  static Bool cvtImageType();
  199. + static Bool cvtSortType();
  200. + static Bool cvtNoop();
  201. X  
  202. X  /* internationalization stuff */
  203. X  
  204. ***************
  205. *** 75,80 ****
  206. --- 77,83 ----
  207. X  /* updaters */
  208. X  
  209. X  static void updButtonFont();
  210. + static void updCursors();
  211. X         void UpdFocusStyle();            /* yes, this one's global */
  212. X  static void updGlyphFont();
  213. X  static void updIconFont();
  214. ***************
  215. *** 381,390 ****
  216. X      &(GRV.UseImageMenu),    cvtImageType,        NULL        },
  217. X  {   "virtualMoveGroup",        "VirtualMoveGroup",    "True",
  218. X      &(GRV.VirtualMoveGroups),    cvtBoolean,        NULL        },
  219. ! {   "pointerWorkspace",        "PointerWorkspace",    "False",
  220. X      &(GRV.PointerWorkspace),    cvtBoolean,        NULL        },
  221. X  {   "saveWorkspaceCmd",        "SaveWorkspaceCmd",    NULL,
  222. X      &(GRV.SaveWorkspaceCmd),    cvtString,        NULL        },
  223. X  };
  224. X  
  225. X  #define NRESOURCEITEMS (sizeof(ResourceTable)/sizeof(ResourceItem))
  226. --- 384,437 ----
  227. X      &(GRV.UseImageMenu),    cvtImageType,        NULL        },
  228. X  {   "virtualMoveGroup",        "VirtualMoveGroup",    "True",
  229. X      &(GRV.VirtualMoveGroups),    cvtBoolean,        NULL        },
  230. ! {   "pointerWorkspace",        "PointerWorkspace",    "True",
  231. X      &(GRV.PointerWorkspace),    cvtBoolean,        NULL        },
  232. X  {   "saveWorkspaceCmd",        "SaveWorkspaceCmd",    NULL,
  233. X      &(GRV.SaveWorkspaceCmd),    cvtString,        NULL        },
  234. + {   "sortMenuType",        "SortMenuType",        "Alphabetic",
  235. +     &(GRV.VirtualMenuSort),    cvtSortType,        NULL        },
  236. + {   "sortDirType",        "SortDirType",        "Alphabetic",
  237. +     &(GRV.VirtualDirSort),    cvtSortType,        NULL        },
  238. + {   "cursorSpecialResize",    "CursorSpecialResize",  "False",
  239. +     &(GRV.SpecialResizePointerData), cvtString,         updCursors    },
  240. + {   "cursorBasic",            "CursorBasic",          "OLC_basic",
  241. +     &(GRV.BasicPointerData),  cvtString,              updCursors      },
  242. + {   "cursorMove",             "CursorMove",           "OLC_basic",
  243. +     &(GRV.MovePointerData),   cvtString,              updCursors      },
  244. + {   "cursorBusy",             "CursorBusy",           "OLC_busy",
  245. +     &(GRV.BusyPointerData),   cvtString,              updCursors      },
  246. + {   "cursorIcon",             "CursorIcon",           "OLC_basic",
  247. +     &(GRV.IconPointerData),   cvtString,              updCursors      },
  248. + {   "cursorResize",           "CursorResize",         "OLC_beye",
  249. +     &(GRV.ResizePointerData), cvtString,              updCursors      },
  250. + {   "cursorMenu",             "CursorMenu",           "OLC_basic",
  251. +     &(GRV.MenuPointerData),   cvtString,              updCursors      },
  252. + {   "cursorQuestion",         "CursorQuestion",       "OLC_basic",
  253. +     &(GRV.QuestionPointerData),       cvtString,      updCursors      },
  254. + {   "cursorTarget",           "CursorTarget",         "OLC_basic",
  255. +     &(GRV.TargetPointerData), cvtString,              updCursors      },
  256. + {   "cursorPan",              "CursorPan",            "OLC_basic",
  257. +     &(GRV.PanPointerData),    cvtString,              updCursors      },
  258. + {   "cursorCloseUp",          "CursorCloseUp",        "OLC_basic",
  259. +     &(GRV.CloseUpPointerData),        cvtString,      updCursors      },
  260. + {   "cursorCloseDown",        "CursorCloseDown",      "OLC_basic",
  261. +     &(GRV.CloseDownPointerData),cvtString,            updCursors      },
  262. + {   "virtualReRead",          "VirtualReRead",        "True",
  263. +     &(GRV.VirtualReRead),     cvtBoolean,             NULL            },
  264. + {   "SyntheticEvents",        "SyntheticEvents",      "False",
  265. +     &(GRV.SyntheticEvents),    cvtBoolean,            NULL            },
  266. + {   "allowSyntheticsEvents",  "AllowSyntheticEvents","False",
  267. +     &(GRV.AllowSyntheticEvents),cvtNoop,              NULL            },
  268. + {   "noVirtualKey",           "NoVirtualKey",         "",
  269. +     &(GRV.NoVirtualKey),      cvtStringList,          NULL,           },
  270. + {   "noVirtualFKey",          "NoVirtualFKey",        "",
  271. +     &(GRV.NoVirtualFKey),     cvtStringList,          NULL,           },
  272. + {   "noVirtualLKey",          "NoVirtualLKey",        "",
  273. +     &(GRV.NoVirtualLKey),     cvtStringList,          NULL,           },
  274. + {   "noVirtualRKey",          "NoVirtualRKey",        "",
  275. +     &(GRV.NoVirtualRKey),     cvtStringList,          NULL,           },
  276. X  };
  277. X  
  278. X  #define NRESOURCEITEMS (sizeof(ResourceTable)/sizeof(ResourceItem))
  279. ***************
  280. *** 396,402 ****
  281. X  /*
  282. X   * Copy a string, converting it to lower case.
  283. X   */
  284. ! static void
  285. X  strnlower(dest, src, n)
  286. X      char *dest;
  287. X      char *src;
  288. --- 443,449 ----
  289. X  /*
  290. X   * Copy a string, converting it to lower case.
  291. X   */
  292. ! void
  293. X  strnlower(dest, src, n)
  294. X      char *dest;
  295. X      char *src;
  296. ***************
  297. *** 436,442 ****
  298. X   * true, false.  Pass back the boolean matched in ret, and return True.  
  299. X   * Otherwise, return False.  Matches are case-insensitive.
  300. X   */
  301. ! static Bool
  302. X  matchBool(value, ret)
  303. X      char *value;
  304. X      Bool *ret;
  305. --- 483,489 ----
  306. X   * true, false.  Pass back the boolean matched in ret, and return True.  
  307. X   * Otherwise, return False.  Matches are case-insensitive.
  308. X   */
  309. ! Bool
  310. X  matchBool(value, ret)
  311. X      char *value;
  312. X      Bool *ret;
  313. ***************
  314. *** 809,814 ****
  315. --- 856,864 ----
  316. X   *
  317. X   * REMIND: this appears to have a resource leak, in that cursorFont is loaded 
  318. X   * but never unloaded.
  319. +  *
  320. +  * This function became obsolete in version 3.2 of olvwm, when all cursors
  321. +  * started to be defined in initCursor in cursor.c
  322. X   */
  323. X  static Bool
  324. X  cvtCursorFont(dpy, item, string, addr)
  325. ***************
  326. *** 817,822 ****
  327. --- 867,873 ----
  328. X      char        *string;
  329. X      void        *addr;
  330. X  {
  331. + #ifdef not
  332. X      Font        cursorFont;
  333. X      int            ii;
  334. X      Cursor        *tmpVariable;
  335. ***************
  336. *** 916,922 ****
  337. X  #endif
  338. X      }
  339. X      }
  340. X      return True;
  341. X  }
  342. X  
  343. --- 967,973 ----
  344. X  #endif
  345. X      }
  346. X      }
  347. ! #endif
  348. X      return True;
  349. X  }
  350. X  
  351. ***************
  352. *** 1483,1489 ****
  353. --- 1534,1542 ----
  354. X      char buf[1000];
  355. X      Bool    found;
  356. X  
  357. +     found = GRV.AllowSyntheticEvents;
  358. X      (void) memset((char *) &GRV, 0, sizeof(GRV));
  359. +     GRV.AllowSyntheticEvents = found;
  360. X  
  361. X  #ifdef OW_I18N_L3
  362. X      GRVLCInit();
  363. ***************
  364. *** 1937,1942 ****
  365. --- 1990,2016 ----
  366. X  
  367. X  static Bool
  368. X  /* ARGSUSED */
  369. + cvtSortType(dpy, item, value, ret)
  370. +     Display        *dpy;
  371. +     ResourceItem    *item;
  372. +     char        *value;
  373. +     VirtualGridType *ret;
  374. + {
  375. +     if (MatchString(value,"alphabetic"))
  376. +     {
  377. +         *ret = SortAlpha;
  378. +         return True;
  379. +     }
  380. +     if (MatchString(value,"youngest"))
  381. +     {
  382. +         *ret = SortYounger;
  383. +         return True;
  384. +     }
  385. +     return False;
  386. + }
  387. + static Bool
  388. + /* ARGSUSED */
  389. X  cvtImageType(dpy, item, value, ret)
  390. X      Display        *dpy;
  391. X      ResourceItem    *item;
  392. ***************
  393. *** 1959,1962 ****
  394. --- 2033,2057 ----
  395. X          return True;
  396. X      }
  397. X      return False;
  398. + }
  399. + static Bool
  400. + /* ARGSUSED */
  401. + cvtNoop(dpy, item, value, ret)
  402. +     Display        *dpy;
  403. +     ResourceItem    *item;
  404. +     char        *value;
  405. +     void         *ret;
  406. + {
  407. +     return False;
  408. + }
  409. + static void
  410. + updCursors(dpy, item, cur, new)
  411. +     Display        *dpy;
  412. +     ResourceItem    *item;
  413. +     char        **cur, **new;
  414. + {
  415. +     /* free the new string, as the cursors never update */
  416. +     MemFree(*new);
  417. X  }
  418. *** BUILD/resources.h    Sat Jun 13 15:49:51 1992
  419. --- src/resources.h    Sat Jun 13 15:43:27 1992
  420. ***************
  421. *** 4,10 ****
  422. X   *      file for terms of the license.
  423. X   */
  424. X  
  425. ! #ident  "@(#)resources.h    1.1 olvwm version 1/3/92"
  426. X  
  427. X  /*
  428. X   * Based on
  429. --- 4,10 ----
  430. X   *      file for terms of the license.
  431. X   */
  432. X  
  433. ! #ident  "@(#)resources.h    1.2 olvwm version 6/13/92"
  434. X  
  435. X  /*
  436. X   * Based on
  437. ***************
  438. *** 40,45 ****
  439. --- 40,47 ----
  440. X  
  441. X  extern void InitGlobals();
  442. X  extern void UpdateGlobals();
  443. + extern Bool matchBool();
  444. X  
  445. X  #ifdef OW_I18N_L3
  446. X  extern void EffectOLLC();
  447. *** BUILD/screen.c    Sat Jun 13 15:51:06 1992
  448. --- src/screen.c    Sat Jun 13 15:43:27 1992
  449. ***************
  450. *** 4,10 ****
  451. X   *      file for terms of the license.
  452. X   */
  453. X  
  454. ! #ident    "@(#)screen.c    1.2 olvwm version 1/27/92"
  455. X  
  456. X  /*
  457. X   * Based on
  458. --- 4,10 ----
  459. X   *      file for terms of the license.
  460. X   */
  461. X  
  462. ! #ident    "@(#)screen.c    1.3 olvwm version 6/13/92"
  463. X  
  464. X  /*
  465. X   * Based on
  466. ***************
  467. *** 36,41 ****
  468. --- 36,42 ----
  469. X  #include "menu.h"
  470. X  #include "slots.h"
  471. X  #include "virtual.h"
  472. + #include "cursors.h"
  473. X  
  474. X  #include "iconimage.h"
  475. X  #include "iconmask.h"
  476. ***************
  477. *** 1363,1369 ****
  478. X      XGCValues       values;
  479. X  static    char        dashList[2] = { 1, 1 };
  480. X      Window        rootwin = scrInfo->rootid;
  481. -     int        screen = scrInfo->screen;
  482. X      unsigned long    valuemask;
  483. X      char        *resString;
  484. X  
  485. --- 1364,1369 ----
  486. ***************
  487. *** 1510,1519 ****
  488. X      values.foreground = values.background = scrInfo->colorInfo.inputBg1Color;
  489. X      values.graphics_exposures = False;
  490. X      values.function = GXcopy;
  491. X      scrInfo->gc[INPUTFOCUS_GC] = XCreateGC(dpy,
  492. X              scrInfo->pixmap[PROTO_DRAWABLE],
  493. X              ( GCFunction | GCForeground | GCBackground |
  494. !                 GCGraphicsExposures ),
  495. X               &values);
  496. X      
  497. X      /*
  498. --- 1510,1520 ----
  499. X      values.foreground = values.background = scrInfo->colorInfo.inputBg1Color;
  500. X      values.graphics_exposures = False;
  501. X      values.function = GXcopy;
  502. +         values.font = GRV.TitleFontInfo->fid;
  503. X      scrInfo->gc[INPUTFOCUS_GC] = XCreateGC(dpy,
  504. X              scrInfo->pixmap[PROTO_DRAWABLE],
  505. X              ( GCFunction | GCForeground | GCBackground |
  506. !                 GCGraphicsExposures | GCFont ),
  507. X               &values);
  508. X      
  509. X      /*
  510. ***************
  511. *** 2009,2015 ****
  512. X        * w/h of resize corner glyph.  Set if unset (ie 0)
  513. X       */
  514. X      if (Resize_width == 0 && Resize_height == 0) {
  515. !         char         s[2];
  516. X          XCharStruct    xcs;
  517. X          int         i1,i2;
  518. X  
  519. --- 2010,2016 ----
  520. X        * w/h of resize corner glyph.  Set if unset (ie 0)
  521. X       */
  522. X      if (Resize_width == 0 && Resize_height == 0) {
  523. !         unsigned char         s[2];
  524. X          XCharStruct    xcs;
  525. X          int         i1,i2;
  526. X  
  527. ***************
  528. *** 2120,2127 ****
  529. X  {
  530. X      ScreenInfo    *scrInfo;
  531. X      Client        *client;
  532. -     char        *s;
  533. -     VirtualResources    *resources;
  534. X  
  535. X      /*
  536. X           *    Create a new ScreenInfo and minimally initialize it
  537. --- 2121,2126 ----
  538. ***************
  539. *** 2150,2155 ****
  540. --- 2149,2155 ----
  541. X      initGCs(dpy,scrInfo);
  542. X      initOLGX(dpy,scrInfo);
  543. X      initFonts(dpy,scrInfo);
  544. +     InitCursors(dpy,scrInfo);
  545. X  
  546. X      /*
  547. X       *    Initialize the screen dependent parts of menus
  548. ***************
  549. *** 2175,2186 ****
  550. X       */
  551. X      ColorFocusInit(dpy,scrInfo->rootwin);
  552. X  
  553. X      /*
  554. X        *    Set the cursor for that screen's root window
  555. X       */
  556. !     if (!GRV.PointerWorkspace)
  557. X          XDefineCursor(dpy,scrInfo->rootid,GRV.BasicPointer);
  558. X  
  559. X      /*
  560. X       * Create VDM for screen
  561. X       */
  562. --- 2175,2198 ----
  563. X       */
  564. X      ColorFocusInit(dpy,scrInfo->rootwin);
  565. X  
  566. +     initVDM(dpy, scrInfo, client);
  567. X      /*
  568. X        *    Set the cursor for that screen's root window
  569. X       */
  570. !     if (GRV.PointerWorkspace)
  571. X          XDefineCursor(dpy,scrInfo->rootid,GRV.BasicPointer);
  572. X  
  573. + }
  574. + initVDM(dpy, scrInfo, client)
  575. +     Display    *dpy;
  576. +     ScreenInfo    *scrInfo;
  577. +     Client    *client;
  578. + {
  579. +     char        *s;
  580. +     VirtualResources    *resources;
  581. X      /*
  582. X       * Create VDM for screen
  583. X       */
  584. ***************
  585. *** 2291,2303 ****
  586. X        */
  587. X      for (si = ListEnum(&l); si; si = ListEnum(&l)) {
  588. X  
  589. -         (*(WinFunc(si->rootwin,core.destroyfunc)))(dpy,si->rootwin);
  590. X  
  591. !         InstallDefaultColormap(dpy,si->rootwin,False);
  592. X  
  593. !         XSetWindowBackgroundPixmap(dpy,si->rootid,None);
  594. !         XClearWindow(dpy,si->rootid);
  595. X          XSetInputFocus(dpy,PointerRoot,RevertToPointerRoot,CurrentTime);
  596. X      }
  597. X  }
  598. --- 2303,2319 ----
  599. X        */
  600. X      for (si = ListEnum(&l); si; si = ListEnum(&l)) {
  601. X  
  602. X  
  603. !         /*
  604. !          * Should only do this if we painted it in the first place
  605. !          */
  606. !         if (GRV.PaintWorkspace) {
  607. !             InstallDefaultColormap(dpy,si->rootwin,False);
  608. !             XSetWindowBackgroundPixmap(dpy,si->rootid,None);
  609. !             XClearWindow(dpy,si->rootid);
  610. !         }
  611. X  
  612. !         (*(WinFunc(si->rootwin,core.destroyfunc)))(dpy,si->rootwin);
  613. X          XSetInputFocus(dpy,PointerRoot,RevertToPointerRoot,CurrentTime);
  614. X      }
  615. X  }
  616. ***************
  617. *** 2600,2606 ****
  618. X      ScreenInfo    *si;
  619. X  {
  620. X  MenuInfo    *info;
  621. - WinPinMenu    *win;
  622. X  XEvent        ev;
  623. X  extern MenuInfo    *FindMenuInfo();
  624. X  
  625. --- 2616,2621 ----
  626. ***************
  627. *** 2609,2615 ****
  628. X      return;
  629. X      info->menuX = GRV.AutoRootMenuX;
  630. X      info->menuY = GRV.AutoRootMenuY;
  631. !     win = MakePinMenu(dpy, si->rootwin, info);
  632. X  }
  633. X  
  634. X  int
  635. --- 2624,2630 ----
  636. X      return;
  637. X      info->menuX = GRV.AutoRootMenuX;
  638. X      info->menuY = GRV.AutoRootMenuY;
  639. !     (void) MakePinMenu(dpy, si->rootwin, info);
  640. X  }
  641. X  
  642. X  int
  643. *** BUILD/slots.c    Sat Jun 13 15:50:18 1992
  644. --- src/slots.c    Sat Jun 13 15:43:28 1992
  645. ***************
  646. *** 4,10 ****
  647. X   *      file for terms of the license.
  648. X   */
  649. X  
  650. ! #ident    "@(#)slots.c    1.1 olvwm version 1/3/92"
  651. X  
  652. X  /*
  653. X   * Based on
  654. --- 4,10 ----
  655. X   *      file for terms of the license.
  656. X   */
  657. X  
  658. ! #ident    "@(#)slots.c    1.2 olvwm version 6/13/92"
  659. X  
  660. X  /*
  661. X   * Based on
  662. ***************
  663. *** 272,280 ****
  664. X          y = iconGrid->pixvert - slot->mi*ICON_GRID_HEIGHT - win->core.height;
  665. X      }
  666. X      }
  667. -     x += slot->off_x;
  668. -     y += slot->off_y;
  669. X      (WinFunc(win,core.newposfunc))(win, x, y);
  670. X  }
  671. X  
  672. --- 272,277 ----
  673. ***************
  674. *** 420,448 ****
  675. X      int        scr_x, scr_y;
  676. X      int        dw, dh;
  677. X  
  678. X      iconGrid->iconList = ListCons(winicon, iconGrid->iconList);
  679. X  
  680. X      if (positioned)
  681. X      {
  682. !     dw = DisplayWidth(winicon->core.client->dpy,
  683. !                         winicon->core.client->screen);
  684. !     dh = DisplayHeight(winicon->core.client->dpy,
  685. !                         winicon->core.client->screen);
  686. !     scr_x = abs((winicon->core.x + ICON_HORZBORDER) % dw);
  687. !     scr_y = abs((winicon->core.y + ICON_VERTBORDER) % dh);
  688. !     slot = incrPositionedSlots(iconGrid, scr_x, scr_y,
  689. X          winicon->core.width, winicon->core.height, snaptogrid);
  690. -     if (winicon->core.x > 0)
  691. -         slot->off_x = ((winicon->core.x + ICON_HORZBORDER) / dw) * dw;
  692. -     else slot->off_x = ((winicon->core.x + ICON_HORZBORDER - dw) / dw) * dw;
  693. -     if (winicon->core.y > 0)
  694. -         slot->off_y = ((winicon->core.y + ICON_VERTBORDER) / dh) * dh;
  695. -     else slot->off_y = ((winicon->core.y + ICON_VERTBORDER - dh) / dh) * dh;
  696. X      winicon->iconslot = slot;
  697. X      if (snaptogrid)
  698. X          setIconPos(winicon, slot);
  699. X      else
  700. !         (WinFunc(winicon,core.newposfunc))(winicon,winicon->core.x,winicon->core.y);
  701. X      }
  702. X      else
  703. X      {
  704. --- 417,444 ----
  705. X      int        scr_x, scr_y;
  706. X      int        dw, dh;
  707. X  
  708. +     dw = DisplayWidth(winicon->core.client->dpy, winicon->core.client->screen);
  709. +     dh = DisplayHeight(winicon->core.client->dpy, winicon->core.client->screen);
  710. +     scr_x = (winicon->core.x + ICON_HORZBORDER) / dw;
  711. +     scr_y = (winicon->core.y + ICON_VERTBORDER) / dh;
  712. +     if (winicon->core.x < -ICON_HORZBORDER)
  713. +     scr_x--;
  714. +     if (winicon->core.y < -ICON_VERTBORDER)
  715. +     scr_y--;
  716. +     winicon->core.x -= scr_x * dw;
  717. +     winicon->core.y -= scr_y * dh;
  718. X      iconGrid->iconList = ListCons(winicon, iconGrid->iconList);
  719. X  
  720. X      if (positioned)
  721. X      {
  722. !     slot = incrPositionedSlots(iconGrid, winicon->core.x, winicon->core.y,
  723. X          winicon->core.width, winicon->core.height, snaptogrid);
  724. X      winicon->iconslot = slot;
  725. X      if (snaptogrid)
  726. X          setIconPos(winicon, slot);
  727. X      else
  728. !         (WinFunc(winicon,core.newposfunc))(winicon,winicon->core.x, winicon->core.y);
  729. X      }
  730. X      else
  731. X      {
  732. ***************
  733. *** 450,461 ****
  734. X          nvert = ROUNDUP(winicon->core.height, ICON_GRID_HEIGHT);
  735. X      setMajorMinor(iconGrid, nvert, nhoriz, &nmajor, &nminor);
  736. X      slot = incrDynamicSlots(iconGrid, nmajor, nminor);
  737. -     slot->off_x = winicon->core.x + ICON_HORZBORDER;
  738. -     slot->off_y = winicon->core.y + ICON_VERTBORDER;
  739. X      winicon->iconslot = slot;
  740. X      setIconPos(winicon,slot);
  741. X      }
  742. X      return slot;
  743. X  }
  744. X  
  745. --- 446,459 ----
  746. X          nvert = ROUNDUP(winicon->core.height, ICON_GRID_HEIGHT);
  747. X      setMajorMinor(iconGrid, nvert, nhoriz, &nmajor, &nminor);
  748. X      slot = incrDynamicSlots(iconGrid, nmajor, nminor);
  749. X      winicon->iconslot = slot;
  750. X      setIconPos(winicon,slot);
  751. X      }
  752. !     if (scr_x || scr_y) {
  753. !         (WinFunc(winicon,core.newposfunc))(winicon,
  754. !                        winicon->core.x + scr_x * dw,
  755. !                        winicon->core.y + scr_y * dh);
  756. !     }
  757. X      return slot;
  758. X  }
  759. X  
  760. *** BUILD/states.c    Sat Jun 13 15:51:08 1992
  761. --- src/states.c    Sat Jun 13 15:43:28 1992
  762. ***************
  763. *** 7,13 ****
  764. X   *    (Normal, Iconic, Withdrawn)
  765. X   */
  766. X  
  767. ! #ident    "@(#)states.c    1.2 olvwm version 1/27/92"
  768. X  
  769. X  /*
  770. X   * Based on
  771. --- 7,13 ----
  772. X   *    (Normal, Iconic, Withdrawn)
  773. X   */
  774. X  
  775. ! #ident    "@(#)states.c    1.3 olvwm version 6/13/92"
  776. X  
  777. X  /*
  778. X   * Based on
  779. ***************
  780. *** 21,26 ****
  781. --- 21,27 ----
  782. X  #include <X11/Xlib.h>
  783. X  #include <X11/Xutil.h>
  784. X  #include <X11/Xatom.h>
  785. + #include <X11/keysym.h>
  786. X  
  787. X  #include "i18n.h"
  788. X  #include "ollocale.h"
  789. ***************
  790. *** 68,73 ****
  791. --- 69,76 ----
  792. X  extern    void    IconPaneSetPixmap();
  793. X  extern    void    IconPaneSetMask();
  794. X  
  795. + static void    checkGroupBinding();
  796. X  /***************************************************************************
  797. X  * private data
  798. X  ***************************************************************************/
  799. ***************
  800. *** 854,860 ****
  801. X      if (!XFetchName(dpy, window, &mc.name))
  802. X          mc.name = NULL;
  803. X      icon_x = icon_y = 0;
  804. !     if (cli->groupmask != GROUP_DEPENDENT)
  805. X          if (cli->wmHints)
  806. X              if (cli->wmHints->flags & IconPositionHint)
  807. X                  SearchProgString(dpy, cli->scrInfo, mc.name,
  808. --- 857,863 ----
  809. X      if (!XFetchName(dpy, window, &mc.name))
  810. X          mc.name = NULL;
  811. X      icon_x = icon_y = 0;
  812. !     if (cli->groupmask != GROUP_DEPENDENT || !GroupLeader(cli->groupid))
  813. X          if (cli->wmHints)
  814. X              if (cli->wmHints->flags & IconPositionHint)
  815. X                  SearchProgString(dpy, cli->scrInfo, mc.name,
  816. ***************
  817. *** 877,892 ****
  818. X          int    dh = DisplayHeight(dpy, screen);
  819. X  
  820. X          if (leader != NULL) {
  821. !         curScreen = leader->framewin->core.x / dw;
  822. !         if (leader->framewin->core.x < 0)
  823. X              curScreen--;
  824. X          if (paneAttr.x + (int) paneAttr.width < 0)
  825. X              paneAttr.x = dw + (paneAttr.x % dw) + (curScreen * dw);
  826. X          else paneAttr.x = (paneAttr.x % dw) + (curScreen * dw);
  827. !         curScreen = leader->framewin->core.y / dh;
  828. !         if (leader->framewin->core.y < 0)
  829. X              curScreen--;
  830. !         if (paneAttr.y + (int) paneAttr.width < 0)
  831. X              paneAttr.y = dh + (paneAttr.y % dh) + (curScreen * dh);
  832. X          else paneAttr.y = (paneAttr.y % dh) + (curScreen * dh);
  833. X          }
  834. --- 880,899 ----
  835. X          int    dh = DisplayHeight(dpy, screen);
  836. X  
  837. X          if (leader != NULL) {
  838. !         curScreen = (leader->framewin->core.x +
  839. !                 (leader->framewin->core.width / 2)) / dw;
  840. !         if (leader->framewin->core.x +
  841. !                 (leader->framewin->core.width / 2) < 0)
  842. X              curScreen--;
  843. X          if (paneAttr.x + (int) paneAttr.width < 0)
  844. X              paneAttr.x = dw + (paneAttr.x % dw) + (curScreen * dw);
  845. X          else paneAttr.x = (paneAttr.x % dw) + (curScreen * dw);
  846. !         curScreen = (leader->framewin->core.y +
  847. !                 (leader->framewin->core.height / 2)) / dh;
  848. !         if (leader->framewin->core.y +
  849. !                 (leader->framewin->core.height / 2) < 0)
  850. X              curScreen--;
  851. !         if (paneAttr.y + (int) paneAttr.height < 0)
  852. X              paneAttr.y = dh + (paneAttr.y % dh) + (curScreen * dh);
  853. X          else paneAttr.y = (paneAttr.y % dh) + (curScreen * dh);
  854. X          }
  855. ***************
  856. *** 936,944 ****
  857. X          /*
  858. X       * We manually move the icon pane window, since all the configuration
  859. X       * has been done with the icon pane parented to root.
  860. !      */
  861. X          WinRootPos(winIconPane, &tmpx, &tmpy);
  862. X          XMoveWindow(dpy, winIconPane->core.self, tmpx, tmpy);
  863. X  
  864. X      /*
  865. X       * Set the sticky bit according to the sticky list.  We check the
  866. --- 943,954 ----
  867. X          /*
  868. X       * We manually move the icon pane window, since all the configuration
  869. X       * has been done with the icon pane parented to root.
  870. !      *
  871. !      * No longer true, since we always have a parented icon frame
  872. !      * now; see winipane.c
  873. X          WinRootPos(winIconPane, &tmpx, &tmpy);
  874. X          XMoveWindow(dpy, winIconPane->core.self, tmpx, tmpy);
  875. +      */
  876. X  
  877. X      /*
  878. X       * Set the sticky bit according to the sticky list.  We check the
  879. ***************
  880. *** 1319,1322 ****
  881. --- 1329,1395 ----
  882. X      XPropertyEvent    *event;
  883. X  {
  884. X      /* REMIND - this needs to be implemented */
  885. + }
  886. + /*
  887. +  * Check to see if a given focus action requires any change to the
  888. +  * key bindings
  889. +  */
  890. + typedef struct {
  891. +     List **list;
  892. +     KeySym start_sym;
  893. +     KeySym end_sym;
  894. +     unsigned int modstate;
  895. +     Boolean  state;
  896. +     char *desc;
  897. + } FocusClosure;
  898. + /*
  899. +  * Check the binding state for a given key group
  900. +  */
  901. + static void
  902. + checkGroupBinding(dpy, mc, focus, fcl)
  903. +     Display *dpy;
  904. +     minimalclosure *mc;
  905. +     Boolean focus;
  906. +     FocusClosure *fcl;
  907. + {
  908. +     List *list = *(fcl->list);
  909. +     Boolean newstate = fcl->state;
  910. +     newstate = focus ? (ListApply(list, matchInstClass, mc) != NULL) : False;
  911. +     if (newstate != fcl->state) {
  912. +       fcl->state = newstate;
  913. +       GrabVKeys(dpy, False, True);
  914. +       SetProgKeys(dpy, fcl->start_sym, fcl->end_sym, fcl->modstate, fcl->state);
  915. +       GrabVKeys(dpy, True, True);
  916. +     }
  917. + }
  918. + /*
  919. +  * Whenever the focus changes, see if we need to enable/disable certain
  920. +  * function keys
  921. +  */
  922. + CheckBindingState(win, focus)
  923. +       WinGenericFrame *win;
  924. +       Boolean focus;
  925. + {
  926. +       int i;
  927. +       minimalclosure mc;
  928. +       static FocusClosure fcl[] = {
  929. +           { &GRV.NoVirtualKey, NoSymbol, NoSymbol, 0L, False, "All" },
  930. +           { &GRV.NoVirtualFKey, XK_F1, XK_F12, 0L, False, "F" },
  931. +           { &GRV.NoVirtualLKey, XK_L1, XK_L10, 0L, False, "L" },
  932. +           { &GRV.NoVirtualRKey, XK_R1, XK_R15, 0L, False, "R" }
  933. +       };
  934. +       mc.name = win->fcore.name;
  935. +       mc.instance = win->core.client->wmInstance;
  936. +       mc.class = win->core.client->wmClass;
  937. +       for ( i = 0; i < sizeof(fcl) / sizeof(fcl[0]); i++)
  938. +           checkGroupBinding(win->core.client->dpy, &mc, focus, &fcl[i]);
  939. X  }
  940. *** BUILD/usermenu.c    Sat Jun 13 15:51:09 1992
  941. --- src/usermenu.c    Sat Jun 13 15:43:29 1992
  942. ***************
  943. *** 4,10 ****
  944. X   *      file for terms of the license.
  945. X   */
  946. X  
  947. ! #ident    "@(#)usermenu.c    1.2 olvwm version 1/27/92"
  948. X  
  949. X  /*
  950. X   * Based on
  951. --- 4,10 ----
  952. X   *      file for terms of the license.
  953. X   */
  954. X  
  955. ! #ident    "@(#)usermenu.c    1.3 olvwm version 6/13/92"
  956. X  
  957. X  /*
  958. X   * Based on
  959. ***************
  960. *** 175,181 ****
  961. X   *    local forward declarations
  962. X   * ---------------------------------------------------------------------
  963. X   */
  964. - static Bool checkFile();
  965. X  static int  menuFromFile();
  966. X  static int  parseMenu();
  967. X  static void fillMenuStruct();
  968. --- 175,180 ----
  969. ***************
  970. *** 601,608 ****
  971. X   * $(OPENWINHOME)/include:${MUBMEL}/include:$FOOBLES/include
  972. X   */
  973. X  
  974. ! static char *
  975. ! expandPath(pin, messages)
  976. X      char *pin;
  977. X      Bool messages;
  978. X  {
  979. --- 600,607 ----
  980. X   * $(OPENWINHOME)/include:${MUBMEL}/include:$FOOBLES/include
  981. X   */
  982. X  
  983. ! char *
  984. ! ExpandPath(pin, messages)
  985. X      char *pin;
  986. X      Bool messages;
  987. X  {
  988. ***************
  989. *** 826,832 ****
  990. X      int         rval;
  991. X  
  992. X      /* expand any environment vars in path */
  993. !     if ((new = expandPath(file, messages)) != NULL)
  994. X      file = new;
  995. X  
  996. X      if ((stream = fopen(file, "r")) == NULL) {
  997. --- 825,831 ----
  998. X      int         rval;
  999. X  
  1000. X      /* expand any environment vars in path */
  1001. !     if ((new = ExpandPath(file, messages)) != NULL)
  1002. X      file = new;
  1003. X  
  1004. X      if ((stream = fopen(file, "r")) == NULL) {
  1005. ***************
  1006. *** 1646,1652 ****
  1007. X   */
  1008. X  static char *windowTitle = "Window";
  1009. X  static char *frameHelpString = "window:FrameMenu";
  1010. - static char *iconHelpString = "window:IconMenu";
  1011. X  
  1012. X  extern Button *MakeOpenButton(), *MakeOwnerButton(), *MakeFullSizeButton(),
  1013. X            *MakePropertiesButton(), *MakeBackButton(),
  1014. --- 1645,1650 ----
  1015. ***************
  1016. *** 1751,1756 ****
  1017. --- 1749,1755 ----
  1018. X          CreateMenu(windowTitle,
  1019. X                 scrInfo->menuButtons.frameDismissButtons, 
  1020. X                 limit_ctbuttons, False, frameHelpString));
  1021. +     InitVDMMenu(dpy, scrInfo);
  1022. X  
  1023. X      /* this sets ROOT_MENU */
  1024. X      InitUserMenu(dpy, scrInfo);
  1025. *** BUILD/virtual.c    Sat Jun 13 15:51:09 1992
  1026. --- src/virtual.c    Sat Jun 13 15:43:31 1992
  1027. ***************
  1028. *** 6,11 ****
  1029. --- 6,12 ----
  1030. X  #include <stdio.h>
  1031. X  #include <string.h>
  1032. X  #include <dirent.h>
  1033. + #include <sys/param.h>
  1034. X  #include <X11/Xos.h>
  1035. X  #include <X11/Xlib.h>
  1036. X  #include <X11/Xutil.h>
  1037. ***************
  1038. *** 28,34 ****
  1039. X  #include "vdm.icon"
  1040. X  #include "vdm.mask"
  1041. X  
  1042. ! #ident "@(#)virtual.c    1.2 olvwm version 1/27/92"
  1043. X  
  1044. X  /* Class Function Vector; a virtual pane is the VDM window in which all
  1045. X   * the little virtual windows appear (and to which said windows are
  1046. --- 29,35 ----
  1047. X  #include "vdm.icon"
  1048. X  #include "vdm.mask"
  1049. X  
  1050. ! #ident "@(#)virtual.c    1.3 olvwm version 6/13/92"
  1051. X  
  1052. X  /* Class Function Vector; a virtual pane is the VDM window in which all
  1053. X   * the little virtual windows appear (and to which said windows are
  1054. ***************
  1055. *** 172,186 ****
  1056. X       */
  1057. X      if (cli->framewin)
  1058. X          XMoveWindow(cli->dpy, cli->framewin->core.virtual,
  1059. !             (cli->framewin->core.x) / cli->scrInfo->vdm->resources->scale +
  1060. X                  cli->scrInfo->vdm->screenX,
  1061. !             (cli->framewin->core.y) / cli->scrInfo->vdm->resources->scale +
  1062. X                  cli->scrInfo->vdm->screenY);
  1063. X      if (cli->iconwin)
  1064. X          XMoveWindow(cli->dpy, cli->iconwin->core.virtual,
  1065. !             (cli->iconwin->core.x) / cli->scrInfo->vdm->resources->scale +
  1066. X                  cli->scrInfo->vdm->screenX,
  1067. !             (cli->iconwin->core.y) / cli->scrInfo->vdm->resources->scale +
  1068. X                  cli->scrInfo->vdm->screenY);
  1069. X      }
  1070. X      return NULL;
  1071. --- 173,187 ----
  1072. X       */
  1073. X      if (cli->framewin)
  1074. X          XMoveWindow(cli->dpy, cli->framewin->core.virtual,
  1075. !         (cli->framewin->core.x) / cli->scrInfo->vdm->resources->scale +
  1076. X                  cli->scrInfo->vdm->screenX,
  1077. !         (cli->framewin->core.y) / cli->scrInfo->vdm->resources->scale +
  1078. X                  cli->scrInfo->vdm->screenY);
  1079. X      if (cli->iconwin)
  1080. X          XMoveWindow(cli->dpy, cli->iconwin->core.virtual,
  1081. !         (cli->iconwin->core.x) / cli->scrInfo->vdm->resources->scale +
  1082. X                  cli->scrInfo->vdm->screenX,
  1083. !         (cli->iconwin->core.y) / cli->scrInfo->vdm->resources->scale +
  1084. X                  cli->scrInfo->vdm->screenY);
  1085. X      }
  1086. X      return NULL;
  1087. ***************
  1088. *** 278,289 ****
  1089. X          deltas.delta_x = dw * .5;
  1090. X          break;
  1091. X      case ACTION_UPLEFT:
  1092. -     case ACTION_ROW_START:
  1093. X          deltas.delta_x = -dw;
  1094. X          deltas.delta_y = -dh;
  1095. X          break;
  1096. X      case ACTION_JUMP_UPLEFT:
  1097. -     case ACTION_DATA_START:
  1098. X          deltas.delta_x = -dw * 20;
  1099. X          deltas.delta_y = -dh * 20;
  1100. X          break;
  1101. --- 279,288 ----
  1102. ***************
  1103. *** 308,319 ****
  1104. X          deltas.delta_y = vdm->offsetY;
  1105. X          break;
  1106. X      case ACTION_DOWNLEFT:
  1107. -     case ACTION_ROW_END:
  1108. X          deltas.delta_x = -dw;
  1109. X          deltas.delta_y = dh;
  1110. X          break;
  1111. X      case ACTION_JUMP_DOWNLEFT:
  1112. -     case ACTION_DATA_END:
  1113. X          deltas.delta_x = -dw * 20;
  1114. X          deltas.delta_y = dh * 20;
  1115. X          break;
  1116. --- 307,316 ----
  1117. ***************
  1118. *** 406,412 ****
  1119. X  
  1120. X      sscanf(v->resources->size, "%dx%d", &width, &height);
  1121. X      if (width < dw)
  1122. !         v->columns = width;
  1123. X      else v->columns = CEIL(width, dw);
  1124. X      if (height < dh)
  1125. X      v->rows = height;
  1126. --- 403,409 ----
  1127. X  
  1128. X      sscanf(v->resources->size, "%dx%d", &width, &height);
  1129. X      if (width < dw)
  1130. !     v->columns = width;
  1131. X      else v->columns = CEIL(width, dw);
  1132. X      if (height < dh)
  1133. X      v->rows = height;
  1134. ***************
  1135. *** 418,425 ****
  1136. X      v->screenWidth = dw / v->resources->scale;
  1137. X      v->screenHeight = dh / v->resources->scale;
  1138. X      if (v->resources->grid) {
  1139. !         v->width = v->columns * v->screenWidth;
  1140. !         v->height = v->rows * v->screenHeight;
  1141. X      }
  1142. X      else {
  1143. X      v->width = v->absoluteWidth / v->resources->scale;
  1144. --- 415,422 ----
  1145. X      v->screenWidth = dw / v->resources->scale;
  1146. X      v->screenHeight = dh / v->resources->scale;
  1147. X      if (v->resources->grid) {
  1148. !     v->width = v->columns * v->screenWidth;
  1149. !     v->height = v->rows * v->screenHeight;
  1150. X      }
  1151. X      else {
  1152. X      v->width = v->absoluteWidth / v->resources->scale;
  1153. ***************
  1154. *** 581,588 ****
  1155. X      case MotionNotify:
  1156. X          if (!event->xmotion.same_screen)
  1157. X          break;
  1158. !         if (XEventsQueued(dpy, QueuedAfterReading) > 0 &&
  1159. !         XPeekEvent(dpy, &nextevent), nextevent.type == MotionNotify)
  1160. X          /* Ignore this event, there's another one coming */
  1161. X          break;
  1162. X          vdmMoveUpdate(event, stuff);
  1163. --- 578,585 ----
  1164. X      case MotionNotify:
  1165. X          if (!event->xmotion.same_screen)
  1166. X          break;
  1167. !         if ((XEventsQueued(dpy, QueuedAfterReading) > 0) &&
  1168. !         (XPeekEvent(dpy, &nextevent), nextevent.type == MotionNotify))
  1169. X          /* Ignore this event, there's another one coming */
  1170. X          break;
  1171. X          vdmMoveUpdate(event, stuff);
  1172. ***************
  1173. *** 841,853 ****
  1174. X  {
  1175. X  }
  1176. X  
  1177. - static
  1178. - winIntNullFunc()
  1179. - {
  1180. -     fprintf(stderr, "WinIntNULL!\n");
  1181. - }
  1182. -  
  1183. X  /*
  1184. X   * setsizePane - set the pane to a particular size, and initiate a reconfigure
  1185. X   */
  1186. --- 838,843 ----
  1187. ***************
  1188. *** 967,974 ****
  1189. X      int    win;
  1190. X      WinVirtual        *w;
  1191. X      VirtualDesktop    *v;
  1192. -     char    title[20];
  1193. -     Button    *vdmButtons[9];
  1194. X  
  1195. X      v = allocVirtualDesktop(dpy, scrInfo->screen, rsc);
  1196. X      w = MemNew(WinVirtual);
  1197. --- 957,962 ----
  1198. ***************
  1199. *** 981,988 ****
  1200. X      sizeHints->min_height = v->screenHeight;
  1201. X      if (rsc->grid) {
  1202. X      sizeHints->flags = PMinSize | PResizeInc;
  1203. !         sizeHints->width_inc = v->screenWidth;
  1204. !         sizeHints->height_inc = v->screenHeight;
  1205. X      }
  1206. X      else sizeHints->flags = PMinSize;
  1207. X  
  1208. --- 969,976 ----
  1209. X      sizeHints->min_height = v->screenHeight;
  1210. X      if (rsc->grid) {
  1211. X      sizeHints->flags = PMinSize | PResizeInc;
  1212. !     sizeHints->width_inc = v->screenWidth;
  1213. !     sizeHints->height_inc = v->screenHeight;
  1214. X      }
  1215. X      else sizeHints->flags = PMinSize;
  1216. X  
  1217. ***************
  1218. *** 1005,1013 ****
  1219. X   
  1220. X      attrMask = CWEventMask;
  1221. X  
  1222. !     if (DefaultDepth(dpy, scrInfo->screen) == 1) {
  1223. !         attrMask |= CWBackPixmap;
  1224. !         attr.background_pixmap = XCreatePixmapFromBitmapData(dpy,
  1225. X              RootWindow(dpy, scrInfo->screen),
  1226. X              pixdata, 8, 2,
  1227. X              scrInfo->colorInfo.fgColor, scrInfo->colorInfo.bgColor,
  1228. --- 993,1001 ----
  1229. X   
  1230. X      attrMask = CWEventMask;
  1231. X  
  1232. !     if ((DefaultDepth(dpy, scrInfo->screen) == 1) && !rsc->background) {
  1233. !     attrMask |= CWBackPixmap;
  1234. !     attr.background_pixmap = XCreatePixmapFromBitmapData(dpy,
  1235. X              RootWindow(dpy, scrInfo->screen),
  1236. X              pixdata, 8, 2,
  1237. X              scrInfo->colorInfo.fgColor, scrInfo->colorInfo.bgColor,
  1238. ***************
  1239. *** 1014,1021 ****
  1240. X              1);
  1241. X      }
  1242. X      else if (!rsc->background) {
  1243. !         attrMask |= CWBackPixel;
  1244. !         attr.background_pixel = scrInfo->colorInfo.virtualBgColor;
  1245. X      }
  1246. X      else {
  1247. X      attrMask |= CWBackPixmap;
  1248. --- 1002,1009 ----
  1249. X              1);
  1250. X      }
  1251. X      else if (!rsc->background) {
  1252. !     attrMask |= CWBackPixel;
  1253. !     attr.background_pixel = scrInfo->colorInfo.virtualBgColor;
  1254. X      }
  1255. X      else {
  1256. X      attrMask |= CWBackPixmap;
  1257. ***************
  1258. *** 1039,1054 ****
  1259. X  
  1260. X      w->core.self = XCreateWindow(dpy, RootWindow(dpy, scrInfo->screen),
  1261. X                      sizeHints->x, sizeHints->y,
  1262. !                         sizeHints->base_width, sizeHints->base_height,
  1263. X                  0,
  1264. X              /* REMIND olwm visual affects this? */
  1265. !                         DefaultDepth(dpy, scrInfo->screen), InputOutput,
  1266. !                         CopyFromParent, attrMask, &attr);
  1267. X      XSetWMProperties(dpy, w->core.self, &wName, &iName, NULL, 0,
  1268. !                  sizeHints, wmHints, classHints);
  1269. X  
  1270. X      WIInstallInfo((WinGeneric *)w);
  1271. X      scrInfo->vdm = v;
  1272. X      v->client = StateNew(dpy, RootWindow(dpy, scrInfo->screen), w->core.self, False, w);
  1273. X      /*
  1274. X       * Sigh -- the call back was called before the icon frame was created
  1275. --- 1027,1043 ----
  1276. X  
  1277. X      w->core.self = XCreateWindow(dpy, RootWindow(dpy, scrInfo->screen),
  1278. X                      sizeHints->x, sizeHints->y,
  1279. !                     sizeHints->base_width, sizeHints->base_height,
  1280. X                  0,
  1281. X              /* REMIND olwm visual affects this? */
  1282. !                     DefaultDepth(dpy, scrInfo->screen), InputOutput,
  1283. !                     CopyFromParent, attrMask, &attr);
  1284. X      XSetWMProperties(dpy, w->core.self, &wName, &iName, NULL, 0,
  1285. !              sizeHints, wmHints, classHints);
  1286. X  
  1287. X      WIInstallInfo((WinGeneric *)w);
  1288. X      scrInfo->vdm = v;
  1289. X      v->client = StateNew(dpy, RootWindow(dpy, scrInfo->screen), w->core.self, False, w);
  1290. X      /*
  1291. X       * Sigh -- the call back was called before the icon frame was created
  1292. ***************
  1293. *** 1064,1069 ****
  1294. --- 1053,1070 ----
  1295. X      VirtualSetGeometry(v->client->iconwin,
  1296. X                 v->client->scrInfo->vdm->resources->iconGeometry);
  1297. X  
  1298. +     XFree(sizeHints);
  1299. +     XFree(wmHints);
  1300. +     XFree(classHints);
  1301. + }
  1302. + InitVDMMenu(dpy, scrInfo)
  1303. +     Display    *dpy;
  1304. +     ScreenInfo    *scrInfo;
  1305. + {
  1306. +     char    title[20];
  1307. +     Button    *vdmButtons[9];
  1308. X      /*
  1309. X       * Make the VDMs menu
  1310. X       */
  1311. ***************
  1312. *** 1082,1093 ****
  1313. X                  True, "olvwm:MotionMenu");
  1314. X      scrInfo->menuTable[MENU_VDM]->prefColSize = 3;
  1315. X      scrInfo->menuTable[MENU_VDM]->buttonDefault = 4;
  1316. -     (void) MenuInfoCreate(scrInfo->menuCache, scrInfo->rootwin,
  1317. -                   scrInfo->menuTable[MENU_VDM], 1);
  1318. -     XFree(sizeHints);
  1319. -     XFree(wmHints);
  1320. -     XFree(classHints);
  1321. X  }
  1322. X  
  1323. X  /*
  1324. --- 1083,1088 ----
  1325. ***************
  1326. *** 1121,1127 ****
  1327. X          x, y, width, height, 1, cli->scrInfo->colorInfo.borderColor,
  1328. X          cli->scrInfo->colorInfo.virtualFgColor);
  1329. X      if (PANEWINOFCLIENT(cli) != PANEWINOFCLIENT(cli->scrInfo->vdm->client))
  1330. !         XSelectInput(cli->dpy, virtual, VDMSelectMask);
  1331. X      else XSelectInput(cli->dpy, virtual, ExposureMask);
  1332. X      cli->framewin->core.virtual = virtual;
  1333. X      VInstallInfo(cli->framewin);
  1334. --- 1116,1122 ----
  1335. X          x, y, width, height, 1, cli->scrInfo->colorInfo.borderColor,
  1336. X          cli->scrInfo->colorInfo.virtualFgColor);
  1337. X      if (PANEWINOFCLIENT(cli) != PANEWINOFCLIENT(cli->scrInfo->vdm->client))
  1338. !     XSelectInput(cli->dpy, virtual, VDMSelectMask);
  1339. X      else XSelectInput(cli->dpy, virtual, ExposureMask);
  1340. X      cli->framewin->core.virtual = virtual;
  1341. X      VInstallInfo(cli->framewin);
  1342. ***************
  1343. *** 1186,1191 ****
  1344. --- 1181,1187 ----
  1345. X                     win->core.client->scrInfo->gc[VDM_GC],
  1346. X               1, win->core.client->scrInfo->vdm->max_ascent + 1,
  1347. X               win->fcore.name, length);
  1348. +     CheckBindingState(win, focus);
  1349. X  }
  1350. X  
  1351. X  /*
  1352. ***************
  1353. *** 1261,1267 ****
  1354. X           * So for this one we pretend it's a double click in the
  1355. X           * VDM itself
  1356. X           */
  1357. !             translateVirtualCoords(win->core.client->scrInfo->vdm,
  1358. X                  &event->xmotion.x_root, &event->xmotion.y_root,
  1359. X                  &event->xmotion.x, &event->xmotion.y);
  1360. X          VDMMoveTo(win->core.client->dpy, win->core.client,
  1361. --- 1257,1263 ----
  1362. X           * So for this one we pretend it's a double click in the
  1363. X           * VDM itself
  1364. X           */
  1365. !         translateVirtualCoords(win->core.client->scrInfo->vdm,
  1366. X                  &event->xmotion.x_root, &event->xmotion.y_root,
  1367. X                  &event->xmotion.x, &event->xmotion.y);
  1368. X          VDMMoveTo(win->core.client->dpy, win->core.client,
  1369. ***************
  1370. *** 1269,1275 ****
  1371. X          return True;
  1372. X          }
  1373. X          if (currentVDMAction == ACTION_MENU)
  1374. !             translateVirtualCoords(win->core.client->scrInfo->vdm,
  1375. X                         NULL, NULL,
  1376. X                         &event->xmotion.x, &event->xmotion.y);
  1377. X          else translateVirtualCoords(win->core.client->scrInfo->vdm,
  1378. --- 1265,1271 ----
  1379. X          return True;
  1380. X          }
  1381. X          if (currentVDMAction == ACTION_MENU)
  1382. !         translateVirtualCoords(win->core.client->scrInfo->vdm,
  1383. X                         NULL, NULL,
  1384. X                         &event->xmotion.x, &event->xmotion.y);
  1385. X          else translateVirtualCoords(win->core.client->scrInfo->vdm,
  1386. ***************
  1387. *** 1289,1295 ****
  1388. X          if (currentVDMAction == ACTION_NONE)
  1389. X          return True;
  1390. X          if (currentVDMAction == ACTION_MENU)
  1391. !             translateVirtualCoords(win->core.client->scrInfo->vdm,
  1392. X                         NULL, NULL,
  1393. X                         &event->xmotion.x, &event->xmotion.y);
  1394. X          else translateVirtualCoords(win->core.client->scrInfo->vdm,
  1395. --- 1285,1291 ----
  1396. X          if (currentVDMAction == ACTION_NONE)
  1397. X          return True;
  1398. X          if (currentVDMAction == ACTION_MENU)
  1399. !         translateVirtualCoords(win->core.client->scrInfo->vdm,
  1400. X                         NULL, NULL,
  1401. X                         &event->xmotion.x, &event->xmotion.y);
  1402. X          else translateVirtualCoords(win->core.client->scrInfo->vdm,
  1403. ***************
  1404. *** 1313,1327 ****
  1405. X      Bool    sticky;
  1406. X  
  1407. X  {
  1408. ! int    dw, dh, x, y;
  1409. X      /*
  1410. X       * Can't unstick the VDM
  1411. X       */
  1412. !     if (cli->groupid == PANEWINOFCLIENT(cli->scrInfo->vdm->client) && !sticky)
  1413. X      return !NULL;
  1414. X      cli->sticky = sticky;
  1415. -     dw = DisplayWidth(cli->dpy, cli->screen);
  1416. -     dh = DisplayHeight(cli->dpy, cli->screen);
  1417. X      if (cli->sticky) {
  1418. X      x = cli->framewin->core.x;
  1419. X      y = cli->framewin->core.y;
  1420. --- 1309,1324 ----
  1421. X      Bool    sticky;
  1422. X  
  1423. X  {
  1424. ! int    x, y;
  1425. X      /*
  1426. X       * Can't unstick the VDM
  1427. X       */
  1428. !     if (cli->groupid == PANEWINOFCLIENT(cli->scrInfo->vdm->client) && !sticky) {
  1429. !     if (GRV.Beep == BeepAlways)
  1430. !         XBell(cli->dpy, 100);
  1431. X      return !NULL;
  1432. +     }
  1433. X      cli->sticky = sticky;
  1434. X      if (cli->sticky) {
  1435. X      x = cli->framewin->core.x;
  1436. X      y = cli->framewin->core.y;
  1437. ***************
  1438. *** 1355,1369 ****
  1439. X  
  1440. X      root = WIGetInfo(ev->xkey.root);
  1441. X      if (!root) {
  1442. !     fprintf(stderr, "NO ROOT\n");
  1443. X      return False;
  1444. X      }
  1445. X      if (!root->core.client) {
  1446. -     fprintf(stderr, "NO CLIENT\n");
  1447. X      return False;
  1448. X      }
  1449. X      if (!root->core.client->scrInfo) {
  1450. -     fprintf(stderr, "NO SCRINFO\n");
  1451. X      return False;
  1452. X      }
  1453. X      vdm = root->core.client->scrInfo->vdm;
  1454. --- 1352,1364 ----
  1455. X  
  1456. X      root = WIGetInfo(ev->xkey.root);
  1457. X      if (!root) {
  1458. !     /* root is not managed by this wm, running in -single mode */
  1459. X      return False;
  1460. X      }
  1461. X      if (!root->core.client) {
  1462. X      return False;
  1463. X      }
  1464. X      if (!root->core.client->scrInfo) {
  1465. X      return False;
  1466. X      }
  1467. X      vdm = root->core.client->scrInfo->vdm;
  1468. ***************
  1469. *** 1404,1414 ****
  1470. X  List        *l = ScreenInfoList;
  1471. X  
  1472. X      for (si = ListEnum(&l); si; si = ListEnum(&l)) {
  1473. !         si->vdm->saveX = si->vdm->offsetX;
  1474. !         si->vdm->saveY = si->vdm->offsetY;
  1475. !         deltas.delta_x = si->vdm->offsetX - x;
  1476. !         deltas.delta_y = si->vdm->offsetY - y;
  1477. !         moveDesktop(dpy, &deltas, si->vdm);
  1478. X      }
  1479. X  }
  1480. X  
  1481. --- 1399,1409 ----
  1482. X  List        *l = ScreenInfoList;
  1483. X  
  1484. X      for (si = ListEnum(&l); si; si = ListEnum(&l)) {
  1485. !     si->vdm->saveX = si->vdm->offsetX;
  1486. !     si->vdm->saveY = si->vdm->offsetY;
  1487. !     deltas.delta_x = si->vdm->offsetX - x;
  1488. !     deltas.delta_y = si->vdm->offsetY - y;
  1489. !     moveDesktop(dpy, &deltas, si->vdm);
  1490. X      }
  1491. X  }
  1492. X  
  1493. ***************
  1494. *** 1420,1428 ****
  1495. X  List        *l = ScreenInfoList;
  1496. X  
  1497. X      for (si = ListEnum(&l); si; si = ListEnum(&l)) {
  1498. !         deltas.delta_x = -si->vdm->saveX;
  1499. !         deltas.delta_y = -si->vdm->saveY;
  1500. !         moveDesktop(dpy, &deltas, si->vdm);
  1501. X      }
  1502. X  }
  1503. X  
  1504. --- 1415,1423 ----
  1505. X  List        *l = ScreenInfoList;
  1506. X  
  1507. X      for (si = ListEnum(&l); si; si = ListEnum(&l)) {
  1508. !     deltas.delta_x = -si->vdm->saveX;
  1509. !     deltas.delta_y = -si->vdm->saveY;
  1510. !     moveDesktop(dpy, &deltas, si->vdm);
  1511. X      }
  1512. X  }
  1513. X  
  1514. ***************
  1515. *** 1476,1482 ****
  1516. X      return NULL;
  1517. X  }
  1518. X  
  1519. ! static void *
  1520. X  updateVirtualWindow(cli)
  1521. X      Client    *cli;
  1522. X  
  1523. --- 1471,1477 ----
  1524. X      return NULL;
  1525. X  }
  1526. X  
  1527. ! static void
  1528. X  updateVirtualWindow(cli)
  1529. X      Client    *cli;
  1530. X  
  1531. ***************
  1532. *** 1512,1520 ****
  1533. X      win = (WinGenericFrame *) vdm->client->framewin;
  1534. X      GFrameSetConfig(win, win->core.x, win->core.y,
  1535. X          vdm->width + (WinFunc(win,fcore.widthleft))(win) +
  1536. !                      (WinFunc(win,fcore.widthright))(win),
  1537. X          vdm->height + (WinFunc(win,fcore.heighttop))(win) +
  1538. !                       (WinFunc(win,fcore.heightbottom))(win));
  1539. X      ListApply(ActiveClientList, remakeVirtual, 0);
  1540. X  }
  1541. X  
  1542. --- 1507,1515 ----
  1543. X      win = (WinGenericFrame *) vdm->client->framewin;
  1544. X      GFrameSetConfig(win, win->core.x, win->core.y,
  1545. X          vdm->width + (WinFunc(win,fcore.widthleft))(win) +
  1546. !                  (WinFunc(win,fcore.widthright))(win),
  1547. X          vdm->height + (WinFunc(win,fcore.heighttop))(win) +
  1548. !                   (WinFunc(win,fcore.heightbottom))(win));
  1549. X      ListApply(ActiveClientList, remakeVirtual, 0);
  1550. X  }
  1551. X  
  1552. ***************
  1553. *** 1537,1562 ****
  1554. X  Display    *dpy = win->core.client->dpy;
  1555. X  ScreenInfo    *scrInfo = win->core.client->scrInfo;
  1556. X  
  1557. !         changed = XParseGeometry(geom, &x, &y, &w, &h);
  1558. !         if (changed & (XValue | YValue)) {
  1559. !             if (changed & XValue)
  1560. !                 if (changed & XNegative)
  1561. !                     newx = DisplayWidth(dpy, scrInfo->screen) + x;
  1562. !                 else newx = x;
  1563. !             else newx = win->core.x;
  1564. X          w = win->core.width;
  1565. !             if (newx > DisplayWidth(dpy, scrInfo->screen) - w)
  1566. !                 newx = DisplayWidth(dpy, scrInfo->screen) - w;
  1567. !             if (changed & YValue)
  1568. !                 if (changed & YNegative)
  1569. !                     newy = DisplayHeight(dpy, scrInfo->screen) + y;
  1570. !                 else newy = y;
  1571. !             else newy = win->core.y;
  1572. X          h = win->core.height;
  1573. !             if (newy > DisplayHeight(dpy, scrInfo->screen) - h)
  1574. !                 newy = DisplayHeight(dpy, scrInfo->screen) - h;
  1575. !             GFrameSetConfig(win, newx, newy, win->core.width, win->core.height);           
  1576. !         }
  1577. X  }
  1578. X  
  1579. X  /*
  1580. --- 1532,1557 ----
  1581. X  Display    *dpy = win->core.client->dpy;
  1582. X  ScreenInfo    *scrInfo = win->core.client->scrInfo;
  1583. X  
  1584. !     changed = XParseGeometry(geom, &x, &y, &w, &h);
  1585. !     if (changed & (XValue | YValue)) {
  1586. !         if (changed & XValue)
  1587. !         if (changed & XNegative)
  1588. !             newx = DisplayWidth(dpy, scrInfo->screen) + x;
  1589. !         else newx = x;
  1590. !         else newx = win->core.x;
  1591. X          w = win->core.width;
  1592. !         if (newx > DisplayWidth(dpy, scrInfo->screen) - w)
  1593. !         newx = DisplayWidth(dpy, scrInfo->screen) - w;
  1594. !         if (changed & YValue)
  1595. !         if (changed & YNegative)
  1596. !             newy = DisplayHeight(dpy, scrInfo->screen) + y;
  1597. !         else newy = y;
  1598. !         else newy = win->core.y;
  1599. X          h = win->core.height;
  1600. !         if (newy > DisplayHeight(dpy, scrInfo->screen) - h)
  1601. !         newy = DisplayHeight(dpy, scrInfo->screen) - h;
  1602. !         GFrameSetConfig(win, newx, newy, win->core.width, win->core.height);       
  1603. !     }
  1604. X  }
  1605. X  
  1606. X  /*
  1607. ***************
  1608. *** 1717,1723 ****
  1609. X      XDestroyWindow(win->core.client->dpy, win->core.self);
  1610. X      WIUninstallInfo(win->core.self);
  1611. X      if (win->core.virtual)
  1612. !         XDestroyWindow(win->core.client->dpy, win->core.virtual);
  1613. X  }
  1614. X  
  1615. X  DeleteProperty(dpy, win, atom)
  1616. --- 1712,1718 ----
  1617. X      XDestroyWindow(win->core.client->dpy, win->core.self);
  1618. X      WIUninstallInfo(win->core.self);
  1619. X      if (win->core.virtual)
  1620. !     XDestroyWindow(win->core.client->dpy, win->core.virtual);
  1621. X  }
  1622. X  
  1623. X  DeleteProperty(dpy, win, atom)
  1624. ***************
  1625. *** 1728,1734 ****
  1626. X  {
  1627. X      XDeleteProperty(dpy, win->core.self, atom);
  1628. X      if (win->core.virtual)
  1629. !         XDeleteProperty(dpy, win->core.virtual, atom);
  1630. X  }
  1631. X  
  1632. X  ChangeProperty(dpy, win, property, type, format, mode, data, nelements)
  1633. --- 1723,1729 ----
  1634. X  {
  1635. X      XDeleteProperty(dpy, win->core.self, atom);
  1636. X      if (win->core.virtual)
  1637. !     XDeleteProperty(dpy, win->core.virtual, atom);
  1638. X  }
  1639. X  
  1640. X  ChangeProperty(dpy, win, property, type, format, mode, data, nelements)
  1641. ***************
  1642. *** 1743,1749 ****
  1643. X      XChangeProperty(dpy, win->core.self, property, type, format,
  1644. X              mode, data, nelements);
  1645. X      if (win->core.virtual)
  1646. !         XChangeProperty(dpy, win->core.virtual, property, type, format,
  1647. X              mode, data, nelements);
  1648. X  }
  1649. X  
  1650. --- 1738,1744 ----
  1651. X      XChangeProperty(dpy, win->core.self, property, type, format,
  1652. X              mode, data, nelements);
  1653. X      if (win->core.virtual)
  1654. !     XChangeProperty(dpy, win->core.virtual, property, type, format,
  1655. X              mode, data, nelements);
  1656. X  }
  1657. X  
  1658. ***************
  1659. *** 1754,1770 ****
  1660. X      XWindowChanges    *values;
  1661. X  
  1662. X  {
  1663. ! int    scale;
  1664. X  WinGeneric    *tmp;
  1665. X  
  1666. X      XConfigureWindow(dpy, win->core.self, mask, values);
  1667. -     scale = win->core.client->scrInfo->vdm->resources->scale;
  1668. X      if (mask & CWX)
  1669. !     values->x = (win->core.x - win->core.client->scrInfo->vdm->offsetX) /
  1670. !             scale;
  1671. X      if (mask & CWY)
  1672. !     values->y = (win->core.y - win->core.client->scrInfo->vdm->offsetY) /
  1673. !             scale;
  1674. X      if (mask & CWWidth)
  1675. X      values->width = win->core.width / scale;
  1676. X      if (mask & CWHeight)
  1677. --- 1749,1785 ----
  1678. X      XWindowChanges    *values;
  1679. X  
  1680. X  {
  1681. ! int        scale;
  1682. X  WinGeneric    *tmp;
  1683. + VirtualDesktop    *vdm;
  1684. X  
  1685. +     vdm = win->core.client->scrInfo->vdm;
  1686. +     /*
  1687. +      * Make sure the window is somewhere on the visible desktop
  1688. +      */
  1689. +     if (win->core.x + (int) win->core.width < vdm->offsetX) {
  1690. +         win->core.x = vdm->offsetX;
  1691. +         win->core.dirtyconfig |= CWX;
  1692. +     }
  1693. +     else if (win->core.x > vdm->absoluteWidth + vdm->offsetX) {
  1694. +         win->core.x = vdm->absoluteWidth + vdm->offsetX - win->core.width;
  1695. +         win->core.dirtyconfig |= CWX;
  1696. +     }
  1697. +     if (win->core.y + (int) win->core.height < vdm->offsetY) {
  1698. +         win->core.y = vdm->offsetY;
  1699. +         win->core.dirtyconfig |= CWY;
  1700. +     }
  1701. +     else if (win->core.y > vdm->absoluteHeight + vdm->offsetY) {
  1702. +         win->core.y = vdm->absoluteHeight + vdm->offsetY - win->core.height;
  1703. +         win->core.dirtyconfig |= CWY;
  1704. +     }      
  1705. +     scale = vdm->resources->scale;
  1706. X      XConfigureWindow(dpy, win->core.self, mask, values);
  1707. X      if (mask & CWX)
  1708. !     values->x = (win->core.x - vdm->offsetX) / scale;
  1709. X      if (mask & CWY)
  1710. !     values->y = (win->core.y - vdm->offsetY) / scale;
  1711. X      if (mask & CWWidth)
  1712. X      values->width = win->core.width / scale;
  1713. X      if (mask & CWHeight)
  1714. ***************
  1715. *** 1777,1786 ****
  1716. X      }
  1717. X      XConfigureWindow(dpy, win->core.virtual, mask, values);
  1718. X      if (GRV.VirtualRaiseVDM)
  1719. !     RaiseWindow(win->core.client->scrInfo->vdm->client->framewin);
  1720. X  }
  1721. X  
  1722. X  /*
  1723. X   * Menu generation function for DIRMENU
  1724. X   *
  1725. X   */
  1726. --- 1792,1815 ----
  1727. X      }
  1728. X      XConfigureWindow(dpy, win->core.virtual, mask, values);
  1729. SHAR_EOF
  1730. true || echo 'restore of olvwm3.Patch02 failed'
  1731. fi
  1732. echo 'End of  part 3'
  1733. echo 'File olvwm3.Patch02 is continued in part 4'
  1734. echo 4 > _shar_seq_.tmp
  1735. exit 0
  1736. -- 
  1737. ---
  1738. Senior Systems Scientist        mail: dcmartin@msi.com
  1739. Molecular Simulations, Inc.        uucp: uunet!dcmartin
  1740. 796 North Pastoria Avenue        at&t: 408/522-9236
  1741.