Inkscape and the system wide GTK Runtime on Windows

General discussions about Inkscape.
User avatar
Hibou57
Posts: 29
Joined: Sat Jan 17, 2009 10:57 pm
Contact:

Inkscape and the system wide GTK Runtime on Windows

Postby Hibou57 » Tue Feb 01, 2011 7:03 pm

Hi all,

Inkscape relies on GTK, GTK a mostly widely used library. There is a system wide GTK Runtime available on Windows (if installed). Many application built upon GTK, does not check for this GTK Runtime. One of the main consequence among others (like useless redundancy) is that it prevent these applications to honor GTK sytem wide preferences.

I tried to write a tiny Batch script which list DLLs in the installed GTK Runtime and remove the duplicated DLL from GTK based applications. I tried it with Inkscape, it works nice, except for one thing : the Document Propery dialog does not work and Inskscape crash, and I cannot figure why.

I was wondering if

1) This is a bug or not.
2) There could be provision for an Inkscape aware of already installed GTK runtime.

I guess an Inkscape shiped with all the GTK Runtime in a bundle is nice for many user, but GTK is also so much widely used that this is not like a specific library, and so the option of an already installed GTK Runtime on the system may be worth.

I will not recommand this simple script for now as it seems Inskscape does not work properly (the incriminated dialog is an important one), however, anyway, here is this simple script :

Note : I tried to apply the same on GIMP, here as well, it works fine, except for one thing : Script-FU complains about a missing libglib. Both Inkscape and GIMP seems to be based on GTK 2.16, while the last GTK Runtime available on Windows is GTK 2.22. So I tried to revert to GTK 2.16, but this was even worst : none of GIMP and Inkscape was starting up at all. Very surprising.

The script :

Code: Select all

@echo off

rem Q: What is this ?
rem A: First step to remove GTK Runtime duplication from Windows applications
rem relying on GTK.
rem
rem Q: What is this useful to ?
rem A: This is useful to save space, help manage sytem configuration (only
rem one GTK runtime instead of multiple occurences) and will allow you
rem to manage GTK preferences globally (system wide or user wide).
rem
rem Q: How it works ?
rem A: It will generate a list of all your GTK runtime DLLs and a file named
rem Step2.bat, whose purpose is to create a backup of the duplicated DLLs
rem and then remove these.
rem
rem Q: Is it dangerous ?
rem A: No, as it do a backup of your DLLs and does not definitelly removed
rem these.
rem
rem Q: OK, so how do use I this ?
rem A: Open a console (CMD.exe) from withing your GTK runtime binary
rem directory (the one where all GTK+ DLLs reside). Then rune Step1.bat.
rem A Step2.bat will be generated. Move this one to the your GIMP or Inkscape
rem binary directory (where the *.exe files reside, this directory may not be
rem named “bin”), or whatever application using a duplicated GTK runtime.
rem Run Step2.bat. You should see a directory named “DLLs_Backup” was
rem created and some DLLs was removed.
rem
rem Last step: launch GIMP or Inkscape (anyway, the application you applied
rem the process to), and check if it works nice. If it does not, then
rem move back all the DLLs from DLLs_Backup to the application directory.
rem If the application works nice (after some time sorking with it), you
rem may safely remove the DLLs_Backup directory.
rem
rem Questions and comments: yannick_duchene@yahoo.fr

echo.
echo ** Please, ensure you've read instructions given in this file **
echo.
echo Step1.
echo Generating Step2.bat ...

echo.>Step2.bat
echo @echo off>>Step2.bat
echo echo.>>Step2.bat
echo echo Step2.>>Step2.bat
echo if not exist DLLs_Backup md DLLs_Backup>>Step2.bat
echo del /Q DLLs_Backup\*.*>>Step2.bat

echo echo Backing up relevant DLLs...>>Step2.bat
for %%f in (*.dll) do echo if exist %%f copy %%f DLLs_Backup>>Step2.bat
echo echo Removing duplicated DLLs...>>Step2.bat
for %%f in (*.dll) do echo if exist %%f del %%f>>Step2.bat
echo echo Done.>>Step2.bat
echo echo.>>Step2.bat
echo echo You may now test if your application works nice.>>Step2.bat

echo Done.
echo You may now proceed to Step2.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Inkscape and the system wide GTK Runtime on Windows

Postby ~suv » Tue Feb 01, 2011 8:18 pm

Hibou57 wrote:Inkscape relies on GTK, GTK a mostly widely used library. There is a system wide GTK Runtime available on Windows (if installed). Many application built upon GTK, does not check for this GTK Runtime.
AFAIU it is not recommended nor supported by the maintainers of the Windows port of GTK+ to use a system-wide GTK+ installation on Windows (search in the gtk+ mailing lists archives for related threads - IIRC one main issue is the lack of a proper package manager on Windows (and Mac OS X) for ported libraries, like it exists on Linux- or Unix-based platforms).

Hibou57 wrote:the Document Propery dialog does not work and Inskscape crash, and I cannot figure why.
Inkscape for Windows knowingly and intentionally ships with a rather old version of GTK+ (2.16.6) because there are too many known issues with later GTK+ versions ported to Windows.

About this specific issue (crash when opening document properties), most likely it's due to some changes in GTK+ 2.22 with regard to GTK+ stock and fallback icons - see bugs #651678 and #658055. Probably you will also be affected by bug #627134.
These three bugs have been fixed in Inkscape trunk and for Inkscape 0.48.1 - but please note that the changes have not been tested for Inkscape builds with GTK+ 2.22.x on Windows.

Hibou57 wrote:2) There could be provision for an Inkscape aware of already installed GTK runtime.
IMHO unlikely to happen and if at all, it has to be addressed upstream for the GTK+ port first, not by each ported application individually.

User avatar
Hibou57
Posts: 29
Joined: Sat Jan 17, 2009 10:57 pm
Contact:

Re: Inkscape and the system wide GTK Runtime on Windows

Postby Hibou57 » Tue Feb 01, 2011 11:36 pm

~suv wrote:AFAIU it is not recommended nor supported by the maintainers of the Windows port of GTK+ to use a system-wide GTK+ installation on Windows

OK, I will seek for some more informations about that.

~suv wrote:About this specific issue (crash when opening document properties), most likely it's due to some changes in GTK+ 2.22 with regard to GTK+ stock and fallback icons - see bugs #651678 and #658055. Probably you will also be affected by bug #627134.

Yes, I had the two first, and also the third.

~suv wrote:These three bugs have been fixed in Inkscape trunk and for Inkscape 0.48.1 - but please note that the changes have not been tested for Inkscape builds with GTK+ 2.22.x on Windows.

Confirmed it is now solved with “Inkscape 0.48+devel r10017” I've just installed (with the gdb parts, if ever I can help this way a future day). Inkscape does not crash any more when the document property sheet is opened while the system wide GTK runtime is in use. The ruler also displays fine (no more multiple arrow-like markers).

Thanks for your comments!

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Inkscape and the system wide GTK Runtime on Windows

Postby ~suv » Sat Jun 04, 2011 5:26 pm

Hibou57, I was wondering if you could help me out with some questions related to the Windows port of Inkscape?

  • The most recent development builds from modevia (>= r10237) now use updated GTK+ and Cairo libraries (for a detailed list see readme.txt from the devlibs (used to build and package Inkscape on Windows)). Did you have a chance to test them lately? Are you aware of any regressions in Inkscape with GTK+ 2.22.1 which haven't been reported yet, or which might seriously affect usability (e.g. disfunctional widgets in the GUI, or problems configuring/using extended input devices like tablet+pen (no pressure-sensitivity, pen not working either in the GUI part or on-canvas, …))?
  • Do you happen to know which GTK+ runtime version the current stable (and unstable, if available) GIMP packages for Windows use? Are they still at GTK+ 2.16.6, or have they been upgraded lately to use the newest runtime versions (2.22.1) provided by gtk.org?

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Inkscape and the system wide GTK Runtime on Windows

Postby druban » Mon Jun 06, 2011 8:22 pm

~suv, I can confirm that in the latest r10237 build for Windows the tablet no longer works, i.e. inkscape closes without any warning. My quick look tells me that in the input devices dialog, what used to be 0,0 (top left corner) is now something like -250??? 0,0 appears to now be in the center of the test area... Maybe this is one of the problems.
When trying to use the stylus one briefly sees the rulers change to a very large number and then quit. Or if one has a drawing tool selected then there are some wild zigzag paths (no stroke or fill) before the quit.

Off topic:
FYI r10216 does not start - could not start missing dll. r10207 seems to be fine..
Your mind is what you think it is.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Inkscape and the system wide GTK Runtime on Windows

Postby ~suv » Tue Jun 07, 2011 7:35 am

druban wrote:in the latest r10237 build for Windows the tablet no longer works, i.e. inkscape closes without any warning.

Are you still using Windows XP and a Wacom Bamboo Pen?

Could you test the latest r10256 with default preferences and without any tricks you might have adopted to make the wacom work with the previous builds and the stable 0.48? Any difference with pressure sensitivity on/off?

Off topic:
druban wrote:FYI r10216 does not start - could not start missing dll. r10207 seems to be fine..
Yes, known issue with one build uploaded to modevia, and fixed soon after (bug #787604).

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Inkscape and the system wide GTK Runtime on Windows

Postby druban » Wed Jun 08, 2011 7:35 pm

Hi `suv. Latest build r10256 - I can use tablet and stylus to draw only by disabling the stylus in input devices. I did remove the prefs I was using and let the app write a brand new prefs file but still it did not work. After unchecking the stylus in the input devices dialog it works as a non-pressure sensitive device. Leaving stylus enabled (checked) in the input devices dialog and disabling pressure sensitivity in either mouse prefs or input devices does not result in usable behaviour.
: ( :( :( :(

Both the stable release and the r10207 build still work, with pressure sensitivity.
Your mind is what you think it is.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Inkscape and the system wide GTK Runtime on Windows

Postby ~suv » Thu Jun 09, 2011 10:46 am

druban wrote:in the latest r10237 build for Windows the tablet no longer works, i.e. inkscape closes without any warning.
druban wrote:Latest build r10256 - I can use tablet and stylus to draw only by disabling the stylus in input devices. I did remove the prefs I was using and let the app write a brand new prefs file but still it did not work. After unchecking the stylus in the input devices dialog it works as a non-pressure sensitive device.
Did the crash re-occur with new prefs / r10256? Do you know if it was triggered by the preferences used with prior versions?

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Inkscape and the system wide GTK Runtime on Windows

Postby druban » Thu Jun 09, 2011 1:10 pm

Did the crash re-occur with new prefs / r10256? Do you know if it was triggered by the preferences used with prior versions?


No crashes- but the errors occurs anytime the stylus is not disabled (and one tries to use the stylus). that is when I let IS build its own prefs and then go in and check the stylus box, it will crash. this happens with the old prefs as well.

1. Delete old prefs, launch r10256.
2. now you can use tablet and work normally, selecting drawing, zooming etc. no pressure tho.
3. open input devices dialog. stylus is not checked. Check it. return to canvas.
4. Try drawing (pencil e.g.) random paths appear momentarily. no sudden crash tho.
5. return to input dev dialog. uncheck stylus. return to canvas. now drawings do not show up on canvas anymore.
6. But no crashes. Random marks, drawing vanishes but no outright crashes.....even when drawing works things seem to have a pause before rendering on canvas.

Does that help?

Incidentally the older builds work fine with the new preferences.
Your mind is what you think it is.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Inkscape and the system wide GTK Runtime on Windows

Postby ~suv » Thu Jun 09, 2011 1:51 pm

druban wrote:Does that help?
Yes - this kind of feedback is much appreciated. Couple of questions though:
  1. druban wrote:when I let IS build its own prefs and then go in and check the stylus box, it will crash.
    vs.
    druban wrote:6. But no crashes.
    Which is it - crash as in 'Inkscape closes without warning, all unsaved data lost' or 'Drawing with an extended input device fails (randomly) | behaves erratically | works with limited functionality (no pressure sensitivity)'?
  2. It would be helpful to have these details filed in the bug tracker: would you mind to file a report, including details about your OS and tablet, the Inkscape revisions used for testing as well as the steps you did to test?

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Inkscape and the system wide GTK Runtime on Windows

Postby druban » Thu Jun 09, 2011 5:38 pm

it's this:
'Drawing with an extended input device fails (randomly) | behaves erratically | works with limited functionality (no pressure sensitivity)'?

But I must emphasize it's only if you want pressure, and this only affects the calligraphy tool. If you don't check the box then the stylus works just like a mouse, and nothing malfunctions.

In the last build (10256) Inkscape no longer crashes as in quits without warning (as it did in build 10237), but if I leave the stylus checked and contnue to try to do things in Inkscape - and everything works except drawing things on canvas - i.e. opening dialogs, preferences, menus, etc. eventually it freezes. The selection tool in particular is very erratic, and switching to this tool and clicking on the canvas instantly transports the view to some remote location as seen in the rulers.

I'll collect my notes and try to file a bug - but the last time I tried that I could not get very far with the process - I seem to remember it kept returning me to the same page...
Your mind is what you think it is.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Inkscape and the system wide GTK Runtime on Windows

Postby brynn » Fri Jun 10, 2011 4:37 am

I'll collect my notes and try to file a bug - but the last time I tried that I could not get very far with the process - I seem to remember it kept returning me to the same page...

Instead of "Report a Bug" on the right side of the main Launchpad page, click "Bugs" from the horizontal menu at the top of the page.

I can''t get the "Report a Bug" link to work right either. Image

leo99
Posts: 1
Joined: Fri Jun 17, 2011 6:52 am
Location: Western USA

Re: Inkscape and the system wide GTK Runtime on Windows

Postby leo99 » Fri Jun 17, 2011 7:19 am

does svg support pressure sensitive lines or in general lines of variable width? I was under an impression it doesn't; any references? if it doesn't, what is the workaround/extension(s) to use svg as data storage format with pressure sensitive drawings? (sorry for the novice question and thanks).


Return to “General Discussions”