Skip to content

highgui: Reduce the difference between GTK+2 and GTK+3 version#23260

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
tintou:tintou/gtk-reduce-diff
Mar 14, 2023
Merged

highgui: Reduce the difference between GTK+2 and GTK+3 version#23260
asmorkalov merged 1 commit intoopencv:4.xfrom
tintou:tintou/gtk-reduce-diff

Conversation

@tintou
Copy link
Copy Markdown
Contributor

@tintou tintou commented Feb 16, 2023

Make the GTK+3 API the default one by wrapping the missing GTK+2 functions in defines Make sure to always guard with GTK_VERSION2 or GTK_VERSION3 to allow future addition of Gtk4

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@mshabunin
Copy link
Copy Markdown
Contributor

There are several warnings (https://pullrequest.opencv.org/buildbot/builders/precommit_linux64/builds/102698):

/build/precommit_linux64/4.x/opencv/modules/highgui/src/window_gtk.cpp:1738:0: warning: "GDK_KEY_Escape" redefined
/build/precommit_linux64/4.x/opencv/modules/highgui/src/window_gtk.cpp:1739:0: warning: "GDK_KEY_Return" redefined
/build/precommit_linux64/4.x/opencv/modules/highgui/src/window_gtk.cpp:1740:0: warning: "GDK_KEY_Linefeed" redefined
/build/precommit_linux64/4.x/opencv/modules/highgui/src/window_gtk.cpp:1741:0: warning: "GDK_KEY_Tab" redefined
/build/precommit_linux64/4.x/opencv/modules/highgui/src/window_gtk.cpp:1742:0: warning: "GDK_KEY_s" redefined
/build/precommit_linux64/4.x/opencv/modules/highgui/src/window_gtk.cpp:1743:0: warning: "GDK_KEY_S" redefined
/build/precommit_linux64/4.x/opencv/modules/highgui/src/window_gtk.cpp:970:73: warning: unused parameter 'event' [-Wunused-parameter]

@tintou tintou force-pushed the tintou/gtk-reduce-diff branch 2 times, most recently from f5c9007 to dfa6edd Compare February 22, 2023 23:22
@tintou
Copy link
Copy Markdown
Contributor Author

tintou commented Feb 22, 2023

The GTK3 Key defines were backported in Gtk2 2.21.8, as we are technically only depending on 2.18.0 I've added a conditional there.

Make the GTK+3 API the default one by wrapping the missing GTK+2 functions in defines
Make sure to always guard with GTK_VERSION2 or GTK_VERSION3 to allow future addition
of Gtk4
@tintou tintou force-pushed the tintou/gtk-reduce-diff branch from dfa6edd to a035608 Compare February 27, 2023 23:50
Copy link
Copy Markdown
Contributor

@mshabunin mshabunin left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@tintou
Copy link
Copy Markdown
Contributor Author

tintou commented Mar 6, 2023

Is there anything else I should do to move forward?

@mshabunin
Copy link
Copy Markdown
Contributor

@tintou , no, let's wait for it to be merged.

@asmorkalov asmorkalov added this to the 4.8.0 milestone Mar 14, 2023
@asmorkalov asmorkalov merged commit de2f766 into opencv:4.x Mar 14, 2023
@asmorkalov asmorkalov mentioned this pull request May 31, 2023
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.

4 participants