After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 642091 - Support transparency in our search popup
Support transparency in our search popup
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
: 647802 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-02-11 09:18 UTC by Ignacio Casal Quinteiro (nacho)
Modified: 2012-08-02 18:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implement compositing support for GeditOverlay (12.47 KB, patch)
2011-04-08 23:32 UTC, jessevdk@gmail.com
needs-work Details | Review
Implement compositing support for GeditOverlay (13.41 KB, patch)
2011-04-09 08:55 UTC, jessevdk@gmail.com
reviewed Details | Review
remove composition (14.35 KB, patch)
2011-04-16 09:51 UTC, Ignacio Casal Quinteiro (nacho)
needs-work Details | Review
overlay child (18.90 KB, patch)
2011-04-16 10:10 UTC, Ignacio Casal Quinteiro (nacho)
needs-work Details | Review

Description Ignacio Casal Quinteiro (nacho) 2011-02-11 09:18:13 UTC
Right now our search popup is a little bit ugly. We should make it transparency using composition or emulate this by making a clip with the parent window.
I've just found out how gnome-panel makes this so maybe we could have a look at
http://git.gnome.org/browse/gnome-panel/tree/applets/notification_area/na-tray-child.c?id=6f9a60b4b810f224b31a5c0ffca4792a107a6d6d
Comment 1 jessevdk@gmail.com 2011-04-08 23:32:35 UTC
Created attachment 185565 [details] [review]
Implement compositing support for GeditOverlay
Comment 2 jessevdk@gmail.com 2011-04-08 23:34:50 UTC
Note that there is one thing that I'm not so sure about if we should do it like this or somewhat different, which is that now the main widget is also embedded in a GeditOverlayChild. This is needed to properly do the compositing, because for example a scrolled window (which we have in gedit) does not have a GdkWindow of its own, meaning it will draw directly on the GeditOverlay in which case the compositing cannot work. Otherwise the patch seems to do the job.
Comment 3 jessevdk@gmail.com 2011-04-09 00:01:11 UTC
I just noticed that with compositing enabled, for some of the themes the background in the text view does not render properly anymore. Presumably because the background color is not set explicitly or something.
Comment 4 Ignacio Casal Quinteiro (nacho) 2011-04-09 08:28:01 UTC
Review of attachment 185565 [details] [review]:

Some things, gedit-overlay-child are supposed to be generic widgets so either do the hack in the slider widget that inherits from gedit-overlay-child and gedit-animated-overlay that inherits from gedit-overlay. To me this is a bit hacky there should be an easier way to do this. See that the overlay is a normal container, if other containers implemented in a similar way like GtkBox etc are able to do compositing without this I don't know why we can't. Anyway I'm ok for adding the hack in the inherited classes for now.
See that this will be added to gtk so I want to avoid this kind of things in the main widgets.
Comment 5 jessevdk@gmail.com 2011-04-09 08:55:58 UTC
Created attachment 185577 [details] [review]
Implement compositing support for GeditOverlay
Comment 6 jessevdk@gmail.com 2011-04-09 08:58:33 UTC
I don't really understand what you mean... no container in gtk+ can do this. I don't think this is a 'hack', this is the way you are supposed to implement compositing in a container where your children can overlap.
Comment 7 jessevdk@gmail.com 2011-04-09 09:05:17 UTC
Just to clarify, what gtk+ does by default (maybe what you refer to) is compositing of one child onto the parent. What is doesn't do is to composite multiple children together on the parent, which is why what want requires manual compositing. As far as I understand it anyway.
Comment 8 Ignacio Casal Quinteiro (nacho) 2011-04-09 09:26:56 UTC
Review of attachment 185577 [details] [review]:

Ok, apart from minor comments it looks good. You are right let's go for it.

::: gedit/gedit-overlay.c
@@ +163,3 @@
+			if (!GEDIT_IS_OVERLAY_CHILD (child))
+			{
+				child = GTK_WIDGET (gedit_overlay_child_new (child));

I guess that you can do gtk_container_add to avoid duplicated code?

::: gedit/gedit-view-frame.c
@@ +1477,3 @@
 	              NULL);
 
+	gtk_widget_override_background_color (frame->priv->slider,

shouldn't you check here that we supports composition before setting it transparent?
Comment 9 Xan Lopez 2011-04-16 00:17:41 UTC
I want to comment on commit ab64e914fb7e9cd198c30437b030eef440fd774e, but since there's no bug for it in the message I'll write here. That patch changes, AFAICT, how the overlay works in that now the main widget property is a GeditOverlayChild (instead of the actual widget), which we don't even export. Among other things this makes epiphany instantaneously crash, since it's an incompatible change. Is this intentional? What is the rationale behind it?

Also, if I workaround that my GtkFrame+GtkLabel packed in the overlay come up completely black.
Comment 10 Ignacio Casal Quinteiro (nacho) 2011-04-16 09:05:59 UTC
Maybe we should just revert the composition patch?
Comment 11 Ignacio Casal Quinteiro (nacho) 2011-04-16 09:07:41 UTC
The issue of this change is to support composition between all the widgets, but since it is imcompatible I guess we should revert and try to put something in for this for 3.2
Comment 12 Ignacio Casal Quinteiro (nacho) 2011-04-16 09:51:26 UTC
Created attachment 186064 [details] [review]
remove composition

This patch removes the composition and leaves the refactorings made.
Comment 13 Ignacio Casal Quinteiro (nacho) 2011-04-16 10:10:23 UTC
Created attachment 186066 [details] [review]
overlay child

Another refactoring in top of the remove composition one.
Comment 14 jessevdk@gmail.com 2011-04-16 15:52:13 UTC
Review of attachment 186064 [details] [review]:

Looks fine with minor comment.

::: gedit/gedit-overlay.c
@@ +393,3 @@
+			else
+			{
+				gtk_widget_destroy (original);

I don't think you want to destroy when removing from the container...
Comment 15 jessevdk@gmail.com 2011-04-16 15:54:01 UTC
Review of attachment 186066 [details] [review]:

There seem to be some other changes here, not related to composition. It would be good to separate them cleanly.
Comment 16 Ignacio Casal Quinteiro (nacho) 2011-04-16 16:32:53 UTC
(In reply to comment #14)
> Review of attachment 186064 [details] [review]:
> 
> Looks fine with minor comment.
> 
> ::: gedit/gedit-overlay.c
> @@ +393,3 @@
> +            else
> +            {
> +                gtk_widget_destroy (original);
> 
> I don't think you want to destroy when removing from the container...
Ups right!
Comment 17 Ignacio Casal Quinteiro (nacho) 2011-04-17 09:59:41 UTC
So the patches are pushed.
Comment 18 Ignacio Casal Quinteiro (nacho) 2011-05-01 10:00:11 UTC
*** Bug 647802 has been marked as a duplicate of this bug. ***
Comment 19 André Klapper 2012-08-02 15:07:41 UTC
What is the status here, of the report and the patches?
Comment 20 Ignacio Casal Quinteiro (nacho) 2012-08-02 18:35:11 UTC
Actually I fixed this like a couple of months ago. Thanks for the reminder.

http://git.gnome.org/browse/gedit/commit/?id=fe7c0fc6ffcd8a034c1805fa3a22e58025b51379