Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6690036

some code cleanup for insets-related code

    XMLWordPrintable

Details

    • b27
    • x86
    • linux
    • Not verified

    Description

      reading insets-related code I've noticed some minor issues which should be corrected to make the code a little bit
      clearer.

      - XDialogPeer and XFramePeer overrides guessInsets() to separatly handle undecorated case.
        but recently isTargetUndecorated() has been moved to XDecoratedPeer, so this special case can be also moved
        to XDecoratedPeer.

      - XWindowPeer has field wm_set_insets and several methods to work with it. But it doesn't use this field,
        only XDecoratedPeer uses. It looks like the only reason why we do have this field in XWindowPeer is that
        XWindowPeer had overriden handlePropertyNotify(XEvent) method at the time the field was added.
        So, I've moved this field and all methods which work with it to XDecoratedPeer.

      - XWindowPeer has field insets, but it only initialize it to (0, 0, 0, 0) and create copy of it in getInsets()
        only XDecoratedPeer uses this field. So we can safely move the field to XDecoratedPeer.

      - after moving insets field to XDecoratedPeer I've noticed that there is another field "currentInsets" which keeps
        the same value as insets. So I've removed insets (because it is easier to fined currentInsets :)

      - as code clean up I've made private as many insets-related methods as possible (also I've mode some of them
        static)

      - also in handleCorrectInsets() I've noticed strange comment:

       340 /*
       341 * Actual insets account for menubar/warning label,
       342 * so we can't assign directly but must adjust them.
       343 */

      but actually we do keep just insets (w/o menubar and warnign label)
      So, I've removed it and simplified the code (now we can just assign insets instead of adjusting them)

      - (this one is not about insets, but about unused code)
        I've noticed atom resize_request (_SUN_AWT_RESIZE_REQUEST) which is used in handleClientMessage()
        but we do not send such message at all. According the history it was added in early days of XAWT and
        in those days we sent the message. But sending message had been removed long time ago, it looks like
        it is a good time to reome rest of that stuff.

      Attachments

        Issue Links

          Activity

            People

              son Oleg Sukhodolsky (Inactive)
              son Oleg Sukhodolsky (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: