Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 391992 - Use gtk_render_arrow instead of gtk_paint_arrow fro GTK+ 3
Summary: Use gtk_render_arrow instead of gtk_paint_arrow fro GTK+ 3
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.3 M3   Edit
Assignee: Alexander Kurtakov CLA
QA Contact:
URL:
Whiteboard: gtk3test
Keywords:
Depends on:
Blocks: 340067
  Show dependency tree
 
Reported: 2012-10-15 15:31 EDT by Anatoly Spektor CLA
Modified: 2012-10-24 14:46 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anatoly Spektor CLA 2012-10-15 15:31:11 EDT
This patch replace gtk_paint_arrow with gtk_render_arrow for GTK+ 3:

http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/commit/?h=gtk3_paint_arrow

Patch is based on 2 pieces of documentation:

1. "angle" and "size" variables determined basing on

 http://git.gnome.org/browse/gtk+/tree/gtk/deprecated/gtkstyle.c#n1805

2. Helper function is based on:

https://mail.gnome.org/archives/commits-list/2012-July/msg07494.html
Comment 1 Alexander Kurtakov CLA 2012-10-16 05:07:23 EDT
Redoing what upstream did is really the right way for now. Merged to master http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=8292090fe3ef8e634ba254763ccf7af619dd517a
Comment 2 Arun Thondapu CLA 2012-10-16 05:40:26 EDT
I think gtk_paint_arrow () can be directly replaced by gtk_render_arrow () as in https://lists.gnome.org/archives/commits-list/2012-June/msg02768.html

The calls to gtk_render_background () and gtk_render_frame () are needed only when replacing gtk_paint_box () according to this - https://lists.gnome.org/archives/commits-list/2012-June/msg02785.html and even https://mail.gnome.org/archives/commits-list/2012-July/msg07494.html from comment 0. So, you can probably get rid of these 3 lines in this case:

OS.gtk_style_context_set_state(context, state_type);
OS.gtk_render_background(context, cairo, x, y, width, height);
OS.gtk_render_frame (context, cairo, x, y, width, height);
Comment 3 Alexander Kurtakov CLA 2012-10-16 06:06:20 EDT
(In reply to comment #2)
> I think gtk_paint_arrow () can be directly replaced by gtk_render_arrow ()
> as in https://lists.gnome.org/archives/commits-list/2012-June/msg02768.html
> 
> The calls to gtk_render_background () and gtk_render_frame () are needed
> only when replacing gtk_paint_box () according to this -
> https://lists.gnome.org/archives/commits-list/2012-June/msg02785.html and
> even https://mail.gnome.org/archives/commits-list/2012-July/msg07494.html
> from comment 0. So, you can probably get rid of these 3 lines in this case:
> 
> OS.gtk_style_context_set_state(context, state_type);
> OS.gtk_render_background(context, cairo, x, y, width, height);
> OS.gtk_render_frame (context, cairo, x, y, width, height);

Yeah, probably you're right but there is only one way to know it - run on top of GTK3.