<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1188</bug_id>
          
          <creation_ts>2015-08-10 15:49:55 +0200</creation_ts>
          <short_desc>NEWT: Window: Support non-resizable, minimize, maximize, alwaysOnBottom and sticky/all-desktop where supported</short_desc>
          <delta_ts>2015-09-27 03:24:57 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Newt</product>
          <component>core</component>
          <version>2.3.2</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>637</dependson>
    
    <dependson>1186</dependson>
          <blocked>1208</blocked>
    
    <blocked>1209</blocked>
    
    <blocked>1214</blocked>
    
    <blocked>1222</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>andres.colubri</cc>
    
    <cc>gouessej</cc>
    
    <cc>maxime-jogamp</cc>
    
    <cc>monsieur.max</cc>
    
    <cc>sorel.johann</cc>
    
    <cc>xerxes</cc>
          
          <cf_type>FEATURE</cf_type>
          <cf_scm_refs>2d837a7a7130702ad36b694875613fae77c7ef06
4a9f65b176d618a8816eff6d24e683c56a4d8086
9ad7f6d6ffe975dc0a10dac159b8de32773e1da1
3ac9eca843d119902a65fdeee5456d204fbabfa4
bb4e7c5d3e13d91810a7530d6ffa0a909fdfc233
2c23b1cb343a008621e3fe642c5b8abacca48b1a
23d8cbd413ac6aca737d7a7d062c8bb6f5ac1ca5
56f03908e476a4630d36282592e12bf20e589fa8
026ea7ed280bf4eb3a0e3c8434e5d993121f3eb4
417546510a93de533562b631caa4a75feeecd793
1d71a21d9d1da21c555207d30d202f724ae269f2
725e9acfcdd0e16a3533d097692a912383bae3fc
522fe5ac2ef057286e4cbfa170aa4292c4ffed2d
cc00d9b6c5a5c6b71ba14311fc6b17ce932d9a1e
fa3c55b8176b284752ed14a5a24f7fee36e588a3</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>4901</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-08-10 15:49:55 +0200</bug_when>
    <thetext></thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4905</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-08-10 16:22:12 +0200</bug_when>
    <thetext>*** Bug 637 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4906</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-08-10 16:24:14 +0200</bug_when>
    <thetext>commit 2d837a7a7130702ad36b694875613fae77c7ef06:

    NEWT Window: Support non-resizable, minimize, maximize, alwaysOnBottom 
    and sticky/all-desktop (Part 1)
    
    Change also implements Bug 1186: &apos;NEWT Window: Use a Bitfield holding 
    all state flags and expose it accordingly&apos;,
    since it is essential for an efficient implementation.
    
    Part 1:
    
    - Bug 1186
      - Using Bitfield, holding public (Window) and private state bits/mask
    
    - Bug 1188
      - Window adds:
           - [is|set]AlwaysOnBottom(..),
           - [is|set]Resizable(..),
           - [is|set]Sticky(..),
           - [is|set]Maximized(..),
           - isChildWindow(),
    
      - Full implementation for X11
    
      - TODO: Implement for OSX and Windows
    
    - Manual tests:
      - TestGearsES2NEWT, TestGearsES2NEWTSimple and TestGearsES2NewtCanvasAWT
        utilize new NewtDemoListener, which has a key-listener to perform
        all [new] actions. See source code of NewtDemoListener.

NEWT X11 impl. also queries the Atoms only once at window creation .. 
reducing the server roundtrip.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4957</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-08-18 05:58:28 +0200</bug_when>
    <thetext>commit 4a9f65b176d618a8816eff6d24e683c56a4d8086

    Fix regression on X11 setVisible: in-visibility never reached on child windows
    
    It has been experienced that UnmapNotify is not sent for child windows 
    when using IconicState!
    Hence the visible:=false event never reaches the Window, causing an error.
    
    This patch only uses IconicState for top-level windows and if requested.

commit 9ad7f6d6ffe975dc0a10dac159b8de32773e1da1
    Fix regression on OSX setVisible: in-visibility never reached 
    on child windows / Fix [Un}Resizable style
    
    - Fix regression on OSX setVisible: in-visibility never reached 
      on child windows
      - Fix &apos;typo&apos; while porting to bit-mask, i.e. &apos;!=&apos; -&gt; &apos;==&apos;.
    
    - Fix [Un}Resizable style
      - Use NSResizableWindowMask only for !Undecorated and 
        if STATE_MASK_RESIZABLE is set.

commit 3ac9eca843d119902a65fdeee5456d204fbabfa4
    OSX: Add maximize horz/vert, implemented manually

commit bb4e7c5d3e13d91810a7530d6ffa0a909fdfc233
    NEWT OSX WindowDriver: Must wait for resize on main-thread (Related to Bug 1188)
    
    If not waiting for resize on main-thread,
    corruption may happen at continued rendering.
    This has been experienced w/ maximize-horizontally (Bug 1188).

commit 2c23b1cb343a008621e3fe642c5b8abacca48b1a
    Refine Maximized on X11 / Impl. Maximized and Iconify on Windows
    
    WindowImpl
      - remove updateMinMaxSize(..) - unused info
      - fix appendStateToString: show all maximized state changes if reconfig
    
      - add sizePosMaxInsetsChanged(..) and sendMouseEventRequestFocus(..)
        accumulating multiple callbacks from impl.
    
      - add: maximizedChanged(..) notification from native impl.
    
      - refine manual maximized mode
        used for OSX and Windows (single extent)
        - reconfigMaximizedManual(..)
        - resetMaximizedManual(..)
    
    X11 WindowDriver:
      - Update maximized at xreconfig, read from _NET_WM_STATE
      - Use less Java callbacks from JNI
    
    Windows WindowDriver:
      - Use native maximized, if HORZ &amp;&amp; VERT,
        otherwise use manual maximized for single extent.
    
      - Invisible of top-window -&gt; MINIMIZED/ICONIFY
        showing the app in task-bar.

commit 23d8cbd413ac6aca737d7a7d062c8bb6f5ac1ca5
    Windows: Implement unresizable using appropriate windows styles
    
    - to avoid resizing when toggling resizable (change of window border)
      we maintain &apos;RECT insets&apos; in our WindowUserData struct
      and fix the client -&gt; top position late 
      in NewtWindow_setVisiblePosSize(..)
      after any style change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4958</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-08-18 06:03:27 +0200</bug_when>
    <thetext>Note: setVisible(false) will show the window in iconized mode where supported
      w/ committed changes.

TODO: Add getSupportedStatesMask(), querying supported features.

Otherwise implementation is as completed on X11, OSX and Windows
as possible. Your test results are welcome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4962</commentid>
    <comment_count>5</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-08-18 11:27:02 +0200</bug_when>
    <thetext>56f03908e476a4630d36282592e12bf20e589fa8
  Add @since 2.3.2 tag</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5040</commentid>
    <comment_count>6</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-08-30 06:48:48 +0200</bug_when>
    <thetext>commit 026ea7ed280bf4eb3a0e3c8434e5d993121f3eb4
    Bug 1188: Cleanup public/private[reconfig, non-reconfig] state bits
    
    - STATE_BIT_FULLSCREEN_SPAN is private and used for reconfigure,
      hence STATE_BIT_COUNT_RECONFIG is needed.
    
    - STATE_BIT_FULLSCREEN_SPAN is added at the end of public state bits
    
    - PSTATE_BIT_MINMAXSIZE_SET is unused.

commit 417546510a93de533562b631caa4a75feeecd793
    Bug 1188: Refine reconfig state bits

commit 1d71a21d9d1da21c555207d30d202f724ae269f2
    Bug 1188: Introduce getSupportedStateMask() implemented via WindowDriver&apos;s getSupportedReconfigMaskImpl()
    
    - See getSupportedStateMask() for semantics
    - getSupportedReconfigMaskImpl() result now used for isReconfigureMaskSupported()
    - getSupportedReconfigMaskImpl() implementations:
      - Full featured: X11, Windows and OSX
      - X11: Use WindowManager Atoms for certain features (dynamic)
      - Others: Use fixed features.
    
    - TODO: Consider avoiding actions if not supported.


commit 725e9acfcdd0e16a3533d097692a912383bae3fc
    Bug 1188: Fix API doc of getSupportedStateMask(); Misc Changes (see below)
    
    - Fix STATE_MASK_CREATENATIVE
    - Simplify resetStateMask()
    - Windows WindowDriver: Remove STATE_MASK_STICKY from supported states
    
    - TestGearsNEWT: Use NEWTDemoListener

commit 522fe5ac2ef057286e4cbfa170aa4292c4ffed2d
    Bug 1188: NEWT WindowsWindow.c: Better support for &apos;isOnBottom&apos; on Windows (Fullscreen on Bottom not working though)
    
    - Terminology
      - ALWAYSONBOTTOM -&gt; isOnBottom
      - ALWAYSONTOP -&gt; isOnTop
    
    - Better support for &apos;isOnBottom&apos; on Windows
      - Refine &apos;SetWindowPos(..)&apos; calls to handle isOn[Top|Bottom]
    
      - Refine &apos;ShowWindow(..)&apos; calls to handle isOnBottom
    
      - Intercept WM_WINDOWPOSCHANGING to enforce isOn[Top|Bottom],
        i.e. change params (hwndInsertAfter and flags).
    
    - Fullscreen on Bottom not working
      - While we change all flags appropriately (NOACTIVATE, ..)
        and don&apos;t issue CDS_FULLSCREEN is on bottom,
        Windows seems to enforce the window to be on top
        if it is sized to the screen maximum.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5041</commentid>
    <comment_count>7</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-08-30 06:49:32 +0200</bug_when>
    <thetext>TODO: Consider avoiding actions if not supported.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5043</commentid>
    <comment_count>8</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-08-30 06:58:19 +0200</bug_when>
    <thetext>Bug 1208 will cont this task, 
i.e. consider avoiding operations if not supported, see getSupportedStateMask().

If severe bugs are still present - please reopen and report.
Closing for now, since implementation is feature complete
as much as possible for X11, Windows and OSX.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5049</commentid>
    <comment_count>9</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-08-31 08:45:20 +0200</bug_when>
    <thetext>cc00d9b6c5a5c6b71ba14311fc6b17ce932d9a1e

   Bug 1188: Refine getSupportedStateMask() semantics and minimum requirements (adding STATE_MASK_FULLSCREEN)
    
    Refine getSupportedStateMask():
     - always for _after_ native creation, i.e. first visibility
     - removed STATE_MASK_AUTOPOSITION
     - adding STATE_MASK_FULLSCREEN to minimum requirements</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5070</commentid>
    <comment_count>10</comment_count>
    <who name="Xerxes Rånby">xerxes</who>
    <bug_when>2015-09-03 16:00:19 +0200</bug_when>
    <thetext>I have found a corner case with the new setResizable implementation that behave unexpected:

https://github.com/xranby/jogl/commit/401a01ba31cf6c98d95a67dfa1021af854438044

Bug 1188: Add junit test test03WindowLargerThanScreenAndNonResizeable
Test that the window do not auto-resize to fit inside the screeen
when the user requests a non-resizable window that is larger than the screen.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5241</commentid>
    <comment_count>11</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-09-26 03:42:31 +0200</bug_when>
    <thetext>commit fa3c55b8176b284752ed14a5a24f7fee36e588a3:

Fix setMaximized(..) isReconfigureMaskSupported(..) query
    
setMaximized(..) isReconfigureMaskSupported(..) was using the state bit-number
instead of the state bit-mask!
    
Fixed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>