device-manager.cpp FTBFS with GSEAL enabled

Bug #911174 reported by Alex Valavanis on 2012-01-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Alex Valavanis

Bug Description

GTK+ 3 hides all private fields of objects using GSEAL. device-manager.cpp fails to build, because it uses private fields of GdkDevice (buildlog attached).

The trouble is that we are defining our own "input devices" by modifying fields of GdkDevice. The GDK+ API does not support setting these fields, so we need to find another way of doing this.

Please could someone who is familiar with device-manager take a look at this?

Alex Valavanis (valavanisalex) wrote :
Alex Valavanis (valavanisalex) wrote :

(reported with lp:inkscape r10829)

tags: added: tablet
su_v (suv-lp) wrote :

@Jon - assigning this report to you: AFAIK you wrote the new input device configuration and hardware test dialog.

Please revert the assignment if you you don't agree and think this was done in error.

Changed in inkscape:
assignee: nobody → Jon A. Cruz (jon-joncruz)
Krzysztof Kosinski (tweenk) wrote :

Removing milestone and dropping priority. This is relevant for GTK3 migration which is a longer term goal.

Changed in inkscape:
milestone: 0.49 → none
importance: High → Medium
Kris (kris-degussem) wrote :

The latest modification in revision 10829 in device-manager.cpp seems to have introduced an error. Did not try myself, but I got this from the log of the latest fail of the launchpad build system:

device-manager.cpp: In member function 'virtual gint Inkscape::InputDeviceImpl::getNumKeys() const':
device-manager.cpp:147: error: 'gdk_device_get_n_keys' was not declared in this scope

Alex Valavanis (valavanisalex) wrote :

Hi Kris,

Yes, that's another error on my part... the gdk_device_get_n_keys function arrived with GTK+ 2.24. I guess you're using an older version. Give me 5 mins to upload a fix. Sorry about this!

Alex Valavanis (valavanisalex) wrote :

Fixed gdk_device_get_n_keys issue in r10832. Hope everything's OK now!

Alex Valavanis (valavanisalex) wrote :

Fix committed in lp:inkscape r10842.

...it turns out I completely knackered the backward compatibility with my previous patch.[1] In the process of fixing it, I have also had a go at fixing the GSEAL issues myself.

@jon - Please could you check I haven't made a complete mess?

A couple of things to note:
* I defined a GdkDeviceFake structure that contains fields which match the private fields of GdkDevice. I then filled in this structure in the CreateFakeList function instead of trying to fill in private fields of GdkDevice.

* The isValidDevice function now does a field-by-field comparison, rather than comparing pointer addresses.

* I didn't include the axes or keys arrays in the comparison... I figured that the rest of the fields would be enough to identify the devices.

* I don't have any fancy input devices, so I couldn't do any proper testing... please check carefully!

* I'm completely new to Gdk device management - apologies if I did anything stupid.

[1] https://launchpadlibrarian.net/89096206/buildlog_ubuntu-lucid-amd64.inkscape_0.49~devel%2B10838%2B6~lucid1_FAILEDTOBUILD.txt.gz

Changed in inkscape:
assignee: Jon A. Cruz (jon-joncruz) → Alex Valavanis (valavanisalex)
status: Triaged → Fix Committed
milestone: none → 0.49
su_v (suv-lp) wrote :

@Alex - it appears that the gdk_device related changes to 'src/desktop-events.cpp' in r10826 (Cleanup GSEAL issues and deprecated GtkTooltips) broke again building with Gtk+ 2.20: fails for Ubuntu Lucid [1], and was reported on the irc channel for r10842 on Debian as well.

AFAICT gdk_device_get_name(), gdk_device_get_source() only exist since 2.22:
<http://developer.gnome.org/gdk/2.24/gdk-Input-Devices.html#gdk-device-get-name>
<http://developer.gnome.org/gdk/2.24/gdk-Input-Devices.html#gdk-device-get-source>

[1] See cafuego's build logs:
<https://launchpad.net/~cafuego/+archive/inkscape/+packages?field.name_filter=&field.status_filter=&field.series_filter=lucid>

build failure:
  CXX desktop-events.o
desktop-events.cpp: In function 'void init_extended()':
desktop-events.cpp:529: error: 'gdk_device_get_name' was not declared in this scope
desktop-events.cpp:531: error: 'gdk_device_get_source' was not declared in this scope
desktop-events.cpp: In function 'void snoop_extended(GdkEvent*, SPDesktop*)':
desktop-events.cpp:566: error: 'gdk_device_get_source' was not declared in this scope
desktop-events.cpp:567: error: 'gdk_device_get_name' was not declared in this scope
desktop-events.cpp:579: error: 'gdk_device_get_source' was not declared in this scope
desktop-events.cpp:580: error: 'gdk_device_get_name' was not declared in this scope
desktop-events.cpp:589: error: 'gdk_device_get_source' was not declared in this scope
desktop-events.cpp:590: error: 'gdk_device_get_name' was not declared in this scope
desktop-events.cpp:600: error: 'gdk_device_get_source' was not declared in this scope
desktop-events.cpp:601: error: 'gdk_device_get_name' was not declared in this scope
make[4]: *** [desktop-events.o] Error 1
make[4]: Leaving directory `/build/buildd/inkscape-0.49~devel+10838+6~lucid1/src'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/build/buildd/inkscape-0.49~devel+10838+6~lucid1/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/build/buildd/inkscape-0.49~devel+10838+6~lucid1'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/build/buildd/inkscape-0.49~devel+10838+6~lucid1'
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

Alex Valavanis (valavanisalex) wrote :

@~suv: Already taken care of in r10842 hopefully :) See comment #8.

Alex Valavanis (valavanisalex) wrote :

Oops... sorry, I didn't see the "reported on the irc channel for r10842 on Debian as well" bit.

I'll look into it now...

Alex Valavanis (valavanisalex) wrote :

OK, without a lucid buildlog for r10842 I can't be 100% sure, but it looks like the GDK API reference didn't mention that the gdk_device_get_has_cursor() function was unavailable before 2.22. Hopefully it's fixed in r10844!

Leoneof (leon3000) wrote :

Hello,
i'm using Debian 6 ,
inkscape : revision 10844

i can't build, and i get errors:

make all-recursive
make[1]: Entering directory `/home/svn/0.49.x'
Making all in src
make[2]: Entering directory `/home/svn/0.49.x/src'
make all-am
make[3]: Entering directory `/home/svn/0.49.x/src'
  CXX arc-context.o
  CXX attributes.o
  CXX attribute-rel-svg.o
  CXX attribute-rel-css.o
  CXX attribute-rel-util.o
  CXX axis-manip.o
  CXX box3d-context.o
  CXX box3d.o
  CXX box3d-side.o
  CXX color.o
  CXX color-profile.o
  CXX common-context.o
  CXX composite-undo-stack-observer.o
  CXX conditions.o
  CXX connection-points.o
  CXX conn-avoid-ref.o
  CXX connector-context.o
  CXX console-output-undo-observer.o
  CXX context-fns.o
  CXX desktop.o
  CXX desktop-events.o
desktop-events.cpp: In function ‘void init_extended()’:
desktop-events.cpp:529: error: ‘gdk_device_get_name’ was not declared in this scope
desktop-events.cpp:531: error: ‘gdk_device_get_source’ was not declared in this scope
desktop-events.cpp: In function ‘void snoop_extended(GdkEvent*, SPDesktop*)’:
desktop-events.cpp:566: error: ‘gdk_device_get_source’ was not declared in this scope
desktop-events.cpp:567: error: ‘gdk_device_get_name’ was not declared in this scope
desktop-events.cpp:579: error: ‘gdk_device_get_source’ was not declared in this scope
desktop-events.cpp:580: error: ‘gdk_device_get_name’ was not declared in this scope
desktop-events.cpp:589: error: ‘gdk_device_get_source’ was not declared in this scope
desktop-events.cpp:590: error: ‘gdk_device_get_name’ was not declared in this scope
desktop-events.cpp:600: error: ‘gdk_device_get_source’ was not declared in this scope
desktop-events.cpp:601: error: ‘gdk_device_get_name’ was not declared in this scope
make[3]: *** [desktop-events.o] Error 1
make[3]: Leaving directory `/home/svn/0.49.x/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/svn/0.49.x/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/svn/0.49.x'
make: *** [all] Error 2

Alex Valavanis (valavanisalex) wrote :

Oh dear... supporting loads of GTK+ versions is a bit of a headache! fix on its way :-s

Alex Valavanis (valavanisalex) wrote :

Fix committed for desktop-events issues in r10846. Let me know if there are still any problems!

Leoneof (leon3000) wrote :

hey Alex :)
just one error:

make all-recursive
make[1]: Entering directory `/home/svn/0.49.x'
Making all in src
make[2]: Entering directory `/home/svn/0.49.x/src'
make all-am
make[3]: Entering directory `/home/svn/0.49.x/src'
  CXX arc-context.o
  CXX attributes.o
  CXX attribute-rel-svg.o
  CXX attribute-rel-css.o
  CXX attribute-rel-util.o
  CXX axis-manip.o
  CXX box3d-context.o
  CXX box3d.o
  CXX box3d-side.o
  CXX color.o
  CXX color-profile.o
  CXX common-context.o
  CXX composite-undo-stack-observer.o
  CXX conditions.o
  CXX connection-points.o
  CXX conn-avoid-ref.o
  CXX connector-context.o
  CXX console-output-undo-observer.o
  CXX context-fns.o
  CXX desktop.o
  CXX desktop-events.o
  CXX desktop-handles.o
  CXX desktop-style.o
  CXX device-manager.o
device-manager.cpp: In member function ‘virtual void Inkscape::DeviceManagerImpl::saveConfig()’:
device-manager.cpp:440: error: ‘struct _GdkDevice’ has no member named ‘axis’
make[3]: *** [device-manager.o] Error 1
make[3]: Leaving directory `/home/svn/0.49.x/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/svn/0.49.x/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/svn/0.49.x'
make: *** [all] Error 2

Alex Valavanis (valavanisalex) wrote :

Gaah! Typo corrected in r10847. Any joy?

Leoneof (leon3000) wrote :

another one :)

 CXX interface.o
interface.cpp: In function ‘void sp_ui_drag_data_received(GtkWidget*, GdkDragContext*, gint, gint, GtkSelectionData*, guint, guint, void*)’:
interface.cpp:1244: error: ‘gdk_drag_context_get_actions’ was not declared in this scope
interface.cpp:1347: error: ‘gdk_drag_context_get_actions’ was not declared in this scope
make[3]: *** [interface.o] Error 1
make[3]: Leaving directory `/home/svn/0.49.x/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/svn/0.49.x/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/svn/0.49.x'
make: *** [all] Error 2

Alex Valavanis (valavanisalex) wrote :

interface.cpp hopefully fixed in r10848.

If you want to compile multiple files at once, you can use something like "make -j4", where the number indicates the number of parallel compilations. You should probably keep this >~ the number of cores in your machine.

Leoneof (leon3000) wrote :

compiled without errors :)
i appreciate your help and efforts.
thank you.

Cafuego (cafuego) wrote :

Yay, 10849 happily builds on Lucid.

Bryce Harrington (bryce) on 2015-02-21
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints