Posted to tcl by patthoyts at Sat Dec 05 17:32:16 GMT 2009view raw

  1. Attempt to sort out the flashing of Tk menu items on Ubuntu.
  2. Doesnt actually work.
  3.  
  4. Index: unix/tkUnixWm.c
  5. ===================================================================
  6. RCS file: /cvsroot/tktoolkit/tk/unix/tkUnixWm.c,v
  7. retrieving revision 1.73
  8. diff -u -p -r1.73 tkUnixWm.c
  9. --- unix/tkUnixWm.c 1 Aug 2009 08:05:11 -0000 1.73
  10. +++ unix/tkUnixWm.c 9 Nov 2009 22:17:00 -0000
  11. @@ -639,6 +639,14 @@ TkWmNewWindow(
  12. */
  13.  
  14. void
  15. +TkSetTransientFor(Tk_Window tkwin, Tk_Window parent)
  16. +{
  17. + XSetTransientForHint(Tk_Display(tkwin),
  18. + ((TkWindow *)tkwin)->wmInfoPtr->wrapperPtr->window,
  19. + ((TkWindow *)parent)->wmInfoPtr->wrapperPtr->window);
  20. +}
  21. +
  22. +void
  23. TkWmMapWindow(
  24. TkWindow *winPtr) /* Top-level window that's about to be
  25. * mapped. */
  26. @@ -668,6 +676,22 @@ TkWmMapWindow(
  27. UpdateTitle(winPtr);
  28. UpdatePhotoIcon(winPtr);
  29.  
  30. + /*
  31. + * Update any class specific hints
  32. + */
  33. + {
  34. + Atom atoms[1];
  35. + Atom _NET_WM_WINDOW_TYPE = Tk_InternAtom((Tk_Window)wmPtr->winPtr,
  36. + "_NET_WM_WINDOW_TYPE_MENU");
  37. + atoms[0] = Tk_InternAtom((Tk_Window)wmPtr->winPtr,
  38. + "_NET_WM_WINDOW_TYPE_UTILITY");
  39. + XChangeProperty(wmPtr->winPtr->display, wmPtr->wrapperPtr->window,
  40. + _NET_WM_WINDOW_TYPE, XA_ATOM, 32, PropModeReplace,
  41. + (unsigned char *) &atoms, 1);
  42. + fprintf(stderr, "set utility window\n");
  43. + }
  44. +
  45. +
  46. if (wmPtr->masterPtr != NULL) {
  47. /*
  48. * Don't map a transient if the master is not mapped.