[Rd] x11 icon and class

Philip Johnson plfjohnson at emory.edu
Wed Jun 13 23:50:49 CEST 2012


On 06/12/2012 03:50 PM, Davor Cubranic wrote:
> On 2012-06-07, at 12:05 PM, Philip Johnson wrote:
>
>> The X11 device driver does not provide the X window manager with an icon (_NET_WM_ICON) or, under some circumstances, with a class (WM_CLASS). This hinders usability under the new stable version of Ubuntu, which has a (new) user interface centered around icons.
>>
>> [...]
>>   2) WM_CLASS (for reasons unclear to me, previously WM_CLASS was only set #ifndef USE_Xt)
>
> A few comments in the bug database give a hint why this is conditional (http://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14588):
>
> (1) "resources are only handled in the Xt case" (comment #1)
> (2) "Still no explanation as to why Xt is not used, and this should be conditional on that case." (comment #3)

True, however, as far as I could tell, these comments do not apply to 
the current code for the following reasons:

(1) ./configure --with-x requires that Xt be present
(2) devX11.c includes a line "#define USE_Xt 1" -- implying that Xt is 
*always* used if compiling for X11
(3) Xt* functions are only used in a single small block in the code, and 
no windows are created in that code -- and thus no X resources are EVER 
set.  I *think* that the only purpose of this code is to test whether 
the window manager allows the user to specify window position and size. 
  But these fields in XSizeHints are noted in the current man pages as 
"obsolete and left solely for compatibility reasons".
(4) deleting all Xt code makes no discernable difference in the device 
driver behaviour on my (admittedly modern) linux distribution.

>
> Now that GUI libraries typically don't rely on Xt any more (e.g., Gtk), but WM_CLASS (and possibly other resources) are still used by window managers, it arguably makes sense for the X11 driver to always set this property.

This is my argument in a nutshell.  I understand there is a general 
reluctance to delete old code because it might still be used on an old 
system somewhere, but I think my proposed change would only be adding 
functionality, not removing it.

After I sent the patch, I discovered that the integration with the new 
Ubuntu interface works even better if WM_CLASS matches the name of the 
executable -- i.e. if the class were "R" rather than "R_x11".  I don't 
want to spam this list, but I am happy to send a revised patch if asked.

Regards,
Philip



More information about the R-devel mailing list