This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 134628 - GTK LAF does not render running under KDE
Summary: GTK LAF does not render running under KDE
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: David Simonek
URL:
Keywords: L&F
Depends on:
Blocks:
 
Reported: 2008-05-06 17:16 UTC by mvaar
Modified: 2008-12-22 14:56 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mvaar 2008-05-06 17:16:01 UTC
Using JDK 1.6 update 6 and netbeans 6.1 on mandriva 2008.1 powerpack, Radeon express 1100, AMD sempron platform.

Netbeans 6.0, running side by side renders GTK LAF of theme I select. I believe it gets the info from .gtkrc. Netbeans 
6.1 ignores the info in .gtkrc-2.0 and renders a dark gray theme, which is different from the defualt metal LAF.

So, the GTK LAF support changed betwen 6.0 and 6.1. It probably works under gnome desktop ( which I do not use and 
don't care for). 6.0 works under KDE.
Comment 1 David Simonek 2008-05-22 09:07:07 UTC
We did no changes to GTK support between 6.0 and 6.1. Generally, GTK L&F won't work on KDE, it works only on gnome. Why
it worked for you I don't know, but we can do nothing with this, as this is handled between JDK and OS. probably you
changed also JDK version or something else.
Comment 2 mvaar 2008-06-10 19:13:38 UTC
I did not post anything because a) you closed the issue without giving me an opportunity to comment and b) I had 
worked around the problem which I will describe below.

At first I thought the same thing but I re-installed netbeans and lo, it worked ! My observation is that once GTK LAF 
is activated ( by creating .gtkrc-2.0 file in my $HOME), I shoudn't mess with it; if I do, no matter how hard I try, I 
cannot get it to work without a reinstall. I can verify that other swing apps do work as expected and so it is NOT a 
JDK issue. I am familiar with qt-gtk-engine and kdecurve and I deactivated them both.

The reason I had to disable GTK was because of bugs in the editor which occur using GTK. The bug pertains to code 
completion causing the editor to not respond for awhile when I backspace entirely over newly entered text during code 
completion - that doesn't seem to happen with vanilla LAF.
Comment 3 David Simonek 2008-06-17 13:14:58 UTC
I'm sorry but I don't understand, description is too complicated for me and i don't know what may be going on or how to
fix this.

I will leave this issue open as you wish, but lowering to P3, as running GTK under KDE is certainly edge case for us.
You are welcomed to find and fix the issue, I'll happily integrate the patch. Code that sets GTK L&F is in
o.n.swing.plaf module, class Startup.java in gtk subfolder.

You wrote that "I can verify that other swing apps do work as expected". Which ones? I wonder which other Swing app use
GTK L&F by default? I don't know such app, so it may be that they are using Metal L&F and that's why it works. Your
findings about .gtkrc-2.0 indicate that problem is in JDK GTK L&F impl.
Comment 4 mvaar 2008-06-19 20:16:35 UTC
>> I will leave this issue open as you wish, but lowering to P3, as running GTK under KDE is certainly edge case for us.

More linux users use KDE than gnome. So I am not sure what you mean by 'edge' case. 


>> You wrote that "I can verify that other swing apps do work as expected". Which ones? I wonder which other Swing app
use GTK L&F by default? I don't know such app, so it may be that they are using Metal L&F and that's why it works. 

You must be kidding ! Yes, I can tell the metal LAF from the GTK LAF I specified - they are visually quite different and
that is why I posted here. Java apps may not use GTK LAF by default but they do when I ask them to, with the
-Dswing.defaultlaf system property. Or if I specify that in the swing.properties file. 

Except netbeans - it doesn't. Incidentally, I even tried the -J-Dswing.defaultlaf in the startup script for netbeans. It
has no effect. This problem seems to be specific to netbeans. Remember what I said. IT WORKS on a NEW netbeans install.
IF I somehow disable the GTK LAF and try to use it again, it doesn't work. 

>> Your findings about .gtkrc-2.0 indicate that problem is in JDK GTK L&F impl.

Read the answer to the last Q. Let us not go back to square one.
Comment 5 David Simonek 2008-06-20 09:22:23 UTC
bug comments shouldn't be a flame war, right? :)

1. -Dswing.defaultlaf: NB doesn't use this property, we have --ui or --laf cmd option instead, which works like
-Dswing.defaultlaf

2. Could you please try to run SwingSet2 demo in your environment, switch it to GTK L&F through menu and try to
reproduce error? I'm almost sure that we didn't change anything between 6.0 and 6.1 that may cause such problems...

3. I have Ubuntu 8.04 on my machine, is there some easy way how I could set up my environment to be similar to yours?
I'm no expert in Linux window managers... 
Comment 6 mvaar 2008-07-21 18:54:59 UTC
Sorry for the delay in updating. This is what I had to do to get it working again -

Deleted root's ~/.netbeans/6.1
Ran netbeans for first time. It found the .gtkrc-2.0 file and used the GTKlaf ( which I specified in netbeans.conf).

Now, when I start netbeans for other users also, it uses GTK LAF.

I cannot nail it - it is very strange and guess it will remain that way. This may be have to do with the fact that
netbeans caches the configuration somewhere and changes aren't always reflected immediately.

It may also be in the netbeans registry information created by the user who installed it.