Skip to content

Update libezgl external subtree #1845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 20, 2021
Merged

Conversation

samehattia
Copy link
Contributor

Description

Update libezgl subtree to the latest version. The latest version adds some bug fixes and functionality (scaling and justification options), and most importantly, uses the left mouse button for panning instead of the middle mouse button.

Related Issue

Motivation and Context

Panning with the left mouse button is easier than the middle button with touchpads. It is also more common.

How Has This Been Tested?

The graphics are tested using the -disp on option. The update does not require any modifications to the VTR code.

Types of changes

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

c2be3f3be The user-defined mouse-press callback is not called in panning mode
bedc70dae Add a default constructor for point2d
cf4d8540f Change the default mouse button used for panning to left
455aa0527 Add justification options for png surfaces
ce4129b95 Add a scaling factor for png surfaces
2c14c50f8 Uniquify application identifier to allow multiple program instances at the same time
fc2c014d4 Force the surface scaling factor to 1 to support HiDPI displays
69bee9383 Change can_focus property for created buttons
c2686ec29 Fix a bug in set_visible_world
88eca9721 Add checks for rotation angles and suface creation
0921d40ec Add ECE297-related code for building the GUI from file
a5aece82f Add ECE297-related code for disabling the event loop

git-subtree-dir: libs/EXTERNAL/libezgl
git-subtree-split: c2be3f3bee394632cee92382fc8e65353a0a2153
libezgl: Updating libs/EXTERNAL/libezgl/ (external git subtree from https://github.com/mariobadr/ezgl.git master)
@samehattia samehattia marked this pull request as draft September 10, 2021 17:21
@samehattia samehattia marked this pull request as ready for review September 10, 2021 18:51
19164c97e Fix shadow warnings

git-subtree-dir: libs/EXTERNAL/libezgl
git-subtree-split: 19164c97e193afc0794bcf2ee5aef984bbb19702
libezgl: Updating libs/EXTERNAL/libezgl/ (external git subtree from https://github.com/mariobadr/ezgl.git master)
Copy link
Contributor

@vaughnbetz vaughnbetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @samehattia . I have some suggestions for readability / commenting / variable naming in a few places that I think would be good to incorporate.

@vaughnbetz
Copy link
Contributor

vaughnbetz commented Sep 10, 2021

Looks like all the runs on kokoro failed due to a build error -- a missing gtk function. The githhub actions completed though, so that implies there is some difference in what gtk version is installed / downloaded on kokoro vs. the github action runners. I'm no expert on where those setup configurations are set -- @MohamedElgammal and @kgugala : do you know where those are set / how to align them?

Consolidate compiler generated dependencies of target ezgl
[ 72%] Building CXX object libs/EXTERNAL/libezgl/CMakeFiles/ezgl.dir/src/application.cpp.o
/tmpfs/src/github/vtr-verilog-to-routing/libs/EXTERNAL/libezgl/src/application.cpp: In member function ‘void ezgl::application::create_button(const char*, int, int, int, int, ezgl::button_callback_fn)’:
/tmpfs/src/github/vtr-verilog-to-routing/libs/EXTERNAL/libezgl/src/application.cpp:328:50: error: ‘gtk_widget_set_focus_on_click’ was not declared in this scope
   gtk_widget_set_focus_on_click(new_button, false);
                                                  ^
libs/EXTERNAL/libezgl/CMakeFiles/ezgl.dir/build.make:75: recipe for target 'libs/EXTERNAL/libezgl/CMakeFiles/ezgl.dir/src/application.cpp.o' failed
make[3]: *** [libs/EXTERNAL/libezgl/CMakeFiles/ezgl.dir/src/application.cpp.o] Error 1
CMakeFiles/Makefile2:1211: recipe for target 'libs/EXTERNAL/libezgl/CMakeFiles/ezgl.dir/all' failed
make[2]: *** [libs/EXTERNAL/libezgl/CMakeFiles/ezgl.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make[1]: *** [all] Error 2
Makefile:71: recipe for target 'all' failed
make: *** [all] Error 2

@vaughnbetz
Copy link
Contributor

@samehattia : it would also be good for you to make sure you run the UI (can run the vtr quick start example with --disp on), and click on everything (see the graphics documentation on the vtr documenation page) and confirm that everything works, panning works, etc. Once you've done that, please note that you've done it in this PR for posterity.

@vaughnbetz
Copy link
Contributor

Looks like the problem function is gtk_widget_set_focus_on_click() which was added after version 3.18.9 and at or before 3.20.0 (see https://abi-laboratory.pro/?view=compat_report&l=gtk+&v1=3.18.9&v2=3.20.0&obj=fa019&kind=abi)
kokoro must have a version of Linux installed with an older version of gtk3. The kokoro setup does
sudo apt-get install -y
with libgtk-3-dev as one of the parameters.
The github runners do almost the same thing but use:
sudo apt install -y
with libgtk-3-dev as one of the parameters

See vtr-verilog-to-routing/.github/scripts/install_dependencies.sh vs. vtr-verilog-to-routing/.github/kokoro/steps/hostsetup.sh

The apt vs. apt-get difference shouldn't matter.
I am not sure why we're getting an older version of gtk on kokoro than github runners; @samehattia : any ideas? I would have thought it would always get the latest version, but perhaps it doesn't change the package if a version is already installed?

@samehattia
Copy link
Contributor Author

@vaughnbetz You are right. kokoro is using Ubunutu 16.04 repos in which the default gtk version is 3.18. The problem function is supported in 3.20+. Two solutions I can think of:

  1. Update Kokoro to use a newer Ubuntu version. Not sure if that is possible (and easy) or not.
  2. Wrap the function call in a #define block with the gtk version.

@mithro
Copy link
Contributor

mithro commented Sep 14, 2021

Longer term, we are working on replacing Kokoro with GitHub Actions runners.

@mithro
Copy link
Contributor

mithro commented Sep 14, 2021

FYI - @QuantamHD

@vaughnbetz
Copy link
Contributor

@samehattia : I suggest guarding the call with an #ifdef for now, unless @mithro or a delegate can update kokoro in the near future. I am not sure how easy it is to upgrade kokoro.
There may be some value to the #ifdef anyway, as it will avoid compilation errors on older OS's (assuming the functionality it guards isn't that important, which I don't think it is).

0e2bcd140 Remove disable_event_loop redundant code
a0a0dbccb Support GTK versions older than 3.20
38a352b29 Refactor mouse panning code
8f63dcb50 Add a g_warning() for invalid surfaces
dd4ea1372 Add clarifying comments
69d908547 Always uniquify application_id in the application::settings constructor

git-subtree-dir: libs/EXTERNAL/libezgl
git-subtree-split: 0e2bcd1400bbaf03842da4fedbc822405e5d2628
libezgl: Updating libs/EXTERNAL/libezgl/ (external git subtree from https://github.com/mariobadr/ezgl.git master)
@samehattia
Copy link
Contributor Author

@vaughnbetz I've included your suggestions. I've also tested the UI using the VTR quick start example with --disp on, and everything looks fine.

@vaughnbetz
Copy link
Contributor

Thanks Sameh!

@vaughnbetz vaughnbetz merged commit 069d5b8 into master Sep 20, 2021
@vaughnbetz vaughnbetz deleted the update_libezgl_external_subtree branch September 20, 2021 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants