<?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>1199</bug_id>
          
          <creation_ts>2015-08-25 22:02:42 +0200</creation_ts>
          <short_desc>Add setting to disable default window icons</short_desc>
          <delta_ts>2015-10-03 12:09:08 +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>1</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>1238</dependson>
          
          <everconfirmed>0</everconfirmed>
          <reporter name="mbastian">mathieu.bastian</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>gouessej</cc>
          
          <cf_type>FEATURE</cf_type>
          <cf_scm_refs>24d30eec425ca6c62f72e7c218a9149777dbec52</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>4992</commentid>
    <comment_count>0</comment_count>
    <who name="mbastian">mathieu.bastian</who>
    <bug_when>2015-08-25 22:02:42 +0200</bug_when>
    <thetext>Setting a default window icon is not desirable for developers using JOGL in applications that already have icons set. The JOGL default icons are overriding existing icons. Can this behavior be disabled with a setting, or be made optional?

There isn&apos;t a clean workaround at the moment, both commands below throw exceptions:

NewtFactory.setWindowIcons(null);
NewtFactory.setWindowIcons(new IOUtil.ClassResources(Foo.class, new String[0]));</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4997</commentid>
    <comment_count>1</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2015-08-26 10:25:05 +0200</bug_when>
    <thetext>Maybe it could be covered by this RFE:
https://jogamp.org/bugzilla/show_bug.cgi?id=1163

Please post the stack traces of the exceptions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4998</commentid>
    <comment_count>2</comment_count>
    <who name="mbastian">mathieu.bastian</who>
    <bug_when>2015-08-26 10:31:11 +0200</bug_when>
    <thetext>Just to be clear, the commands above don&apos;t throw an exception right away but when the window is initialized.

Stack trace for the first case:
java.lang.NullPointerException
	at jogamp.newt.driver.macosx.DisplayDriver.&lt;clinit&gt;(DisplayDriver.java:72)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.jogamp.newt.NewtFactory.getCustomClass(NewtFactory.java:111)
	at jogamp.newt.DisplayImpl.getDisplayClass(DisplayImpl.java:260)
	at jogamp.newt.DisplayImpl.create(DisplayImpl.java:270)
	at com.jogamp.newt.NewtFactory.createDisplay(NewtFactory.java:203)
	at com.jogamp.newt.NewtFactory.createWindowImpl(NewtFactory.java:309)
	at com.jogamp.newt.NewtFactory.createWindow(NewtFactory.java:234)
	at com.jogamp.newt.opengl.GLWindow.create(GLWindow.java:168)

Stack trace for the second case:
java.lang.ArrayIndexOutOfBoundsException: -1
	at com.jogamp.common.util.IOUtil$ClassResources.resolve(IOUtil.java:458)
	at jogamp.newt.driver.macosx.DisplayDriver.&lt;clinit&gt;(DisplayDriver.java:72)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.jogamp.newt.NewtFactory.getCustomClass(NewtFactory.java:111)
	at jogamp.newt.DisplayImpl.getDisplayClass(DisplayImpl.java:260)
	at jogamp.newt.DisplayImpl.create(DisplayImpl.java:270)
	at com.jogamp.newt.NewtFactory.createDisplay(NewtFactory.java:203)
	at com.jogamp.newt.NewtFactory.createWindowImpl(NewtFactory.java:309)
	at com.jogamp.newt.NewtFactory.createWindow(NewtFactory.java:234)
	at com.jogamp.newt.opengl.GLWindow.create(GLWindow.java:168)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5002</commentid>
    <comment_count>3</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2015-08-26 16:29:44 +0200</bug_when>
    <thetext>In my humble opinion, it would be nice to be able to stop overriding the window icon when newt.window.icons is set to &quot;&quot;. Then, you wouldn&apos;t have to set it once again by using this property.

In the meantime, please tell me what happens when you set newt.window.icons to &quot;&quot;, you can still set this property to a valid value in order to use your icon, can&apos;t you?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5003</commentid>
    <comment_count>4</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2015-08-26 16:47:39 +0200</bug_when>
    <thetext>I suggest the following changes:
https://github.com/sgothel/jogl/blob/master/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java#L71
https://github.com/sgothel/jogl/blob/master/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java#L68
https://github.com/sgothel/jogl/blob/master/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java#L80
The code above should be modified to support &quot;null&quot; and the documentation of this method should be updated:
https://github.com/sgothel/jogl/blob/master/src/newt/classes/com/jogamp/newt/NewtFactory.java#L99</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5004</commentid>
    <comment_count>5</comment_count>
    <who name="mbastian">mathieu.bastian</who>
    <bug_when>2015-08-26 16:55:14 +0200</bug_when>
    <thetext>I tried to set the newt.window.icons to &quot;&quot; and I also got an exception at startup.

java.lang.IllegalArgumentException: Property &apos;newt.window.icons&apos; did not specify at least two PNG icons, but []
	at com.jogamp.newt.NewtFactory$1.run(NewtFactory.java:72)

I could potentially set the property to a valid values but I would prefer not because my application is built on top of Netbeans Platform, which does provide it&apos;s own window icons mechanism. I would stop using the default built-in mechanism if I was to use the JOGL property and I would find this less robust and clean.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5328</commentid>
    <comment_count>6</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-10-03 12:09:08 +0200</bug_when>
    <thetext>See Bug 1238 comment 3.

Fix for Bug 1238 also solves this bug&apos;s issue.

+++

commit 24d30eec425ca6c62f72e7c218a9149777dbec52

    Bug 1238 - Fix NPE for Window-Icon&apos;s PNGPixelRect for unresolved location; Bug 1199 - Add setting to disable default window icons
    
    Bug 1238 - Fix NPE for Window-Icon&apos;s PNGPixelRect for unresolved location, i.e. null URLConnections
    
    Testing w/ jogl/make/scripts/tests.sh USE_BUILDDIR=1,
    discloses this issue - since the icons are available in jar only.
    
    Handling all unresolved resources, i.e. null URLConnection,
    is required.
    
    Further more, the icon list passed via property &apos;newt.window.icons&apos;
    shall be separated by comma as well.
    This allows passing the list via scripts more conveniently.
      -Dnewt.window.icons=&quot;newt/data/jogamp-16x16.png,newt/data/jogamp-32x32.png&quot;
    
    +++
    
    Bug 1199 - Add setting to disable default window icons
    
    This patch also allows disabling JogAmp&apos;s own window icons
    by simply defining a non-existing location, i.e.
      -Dnewt.window.icons=&quot;null,null&quot;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>