Re: [webkit-gtk] GtkLauncher scrolling problem

2011-05-26 Thread Brendan Taylor
On Thu, May 26, 2011 at 09:55:43AM -0300, Gustavo Noronha Silva wrote:
> In my tests with the code you provided if I add more lines of text to
> the textbuffer the window grows to fit it, as expected, doesn't it for
> you? What am I missing?

Ah, you're right. When I tell my WM to respect size hints, I see the 
same thing.

I think I'm going to abandon this path, it's far more trouble than it's 
worth. Instead users who don't want scrollbars can make a 
gtk.css/.gtkrc-2.0 that sets them to width 0.
___
webkit-gtk mailing list
webkit-gtk@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk


Re: [webkit-gtk] GtkLauncher scrolling problem

2011-05-26 Thread Gustavo Noronha Silva
On Thu, 2011-05-26 at 02:38 +, Brendan Taylor wrote:
> This has been quite helpful in clearing up why I'm getting the results I 
> am, but I don't know if I'm any closer to a solution.
> 
> I tried hooking this up to the ScrolledWindow's size-request signal:

That was to the allocate signal it seems? You should override the
request, or enforce a different allocation. What you did bellow was just
manually do what GTK+ would do anyway =).

> 
> void scrolled_win_size_allocate(GtkWidget *scrolled_win, GtkAllocation 
> *allocation) {
>   gtk_widget_size_allocate(GTK_WIDGET(uzbl.gui.web_view), allocation);
> }
> 
> But this seems to have the same result as gtk_scrolled_window_set_policy(sw, 
> AUTO, AUTO),
> i.e. scrollbars appear when the page content is bigger than the size 
> that has been allocated to the WebView.

If you keep the policy as AUTO, or let the webview set it to auto by not
handling that signal, then you will get scrollbars.

> > This is not specific to WebKitGTK+, it's also how GtkTextView works. 
> 
> This is why I'm confused; there's some difference between the two, 
> because I can easily make a TextView in a ScrolledWindow that is 
> scrollable, limited to the size of its parent container, and does not 
> display scrollbars.[1]

In my tests with the code you provided if I add more lines of text to
the textbuffer the window grows to fit it, as expected, doesn't it for
you? What am I missing?

Cheers,

-- 
Gustavo Noronha Silva 
GNOME Project

___
webkit-gtk mailing list
webkit-gtk@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk


Re: [webkit-gtk] GtkLauncher scrolling problem

2011-05-25 Thread Brendan Taylor
(Restating the problem: I want to be able to scroll the contents of a 
WebView without displaying any scrollbars.  Assume for simplicity that 
we're talking about really boring HTML, I realise that frames and the 
CSS overflow property are separate issues.)

On Wed, May 25, 2011 at 12:14:46PM -0300, Gustavo Noronha Silva wrote:
> The problem is GtkScrolledWindow does not have a "make it scrollable 
> but
> do not draw scrollbars" mode, because it assumes the widget does not
> scroll by itself - so when you set the policy to NEVER you are
> essentially telling it to respect the widget's size request. GTK+ 2
> widgets request as big a size as is required for the whole of the
> contents to be shown, which in this case is the full size of the page
> contents.

This has been quite helpful in clearing up why I'm getting the results I 
am, but I don't know if I'm any closer to a solution.

I tried hooking this up to the ScrolledWindow's size-request signal:

void scrolled_win_size_allocate(GtkWidget *scrolled_win, GtkAllocation 
*allocation) {
  gtk_widget_size_allocate(GTK_WIDGET(uzbl.gui.web_view), allocation);
}

But this seems to have the same result as gtk_scrolled_window_set_policy(sw, 
AUTO, AUTO),
i.e. scrollbars appear when the page content is bigger than the size 
that has been allocated to the WebView.

> This is not specific to WebKitGTK+, it's also how GtkTextView works. 

This is why I'm confused; there's some difference between the two, 
because I can easily make a TextView in a ScrolledWindow that is 
scrollable, limited to the size of its parent container, and does not 
display scrollbars.[1]

The same technique used to work with a WebView. At some point it stopped 
working; now the WebView ends up in its natural size, most of which is 
offscreen.

> I asked if the problem was in a specific page because even after you've
> done all of the above, some pages will still display scrollbars, like
> gmail, because it uses tricks to make the contents be the size of the
> browser's viewport and then uses html structures to create the
> scrollable part.

Yes, I'm aware that this is a separate issue.

[1]: Demoed in the second attachment to 
https://bugs.webkit.org/show_bug.cgi?id=59197
___
webkit-gtk mailing list
webkit-gtk@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk


Re: [webkit-gtk] GtkLauncher scrolling problem

2011-05-25 Thread Gustavo Noronha Silva
Hey,

On Tue, 2011-05-24 at 14:08 +, Brendan Taylor wrote:
> On Tue, May 24, 2011 at 11:57:56AM +0200, Maxime de Roucy wrote:
> > If I handle the signal and set the gtkscrolledwindow policy to
> > GTK_POLICY_NEVER. The scrollbar does appear but the window is
> > automatically resized by the webkit webview to fit the whole web page.
> > Which isn't what I want.
> > 
> > So : It seams it is now impossible to use webkit without a scrollbar.
> 
> We're experiencing this too, it's quite annoying. We first noticed it 
> when migrating to GTK3, but seems to occur on GTK2 as well in some 
> cases.

The problem is GtkScrolledWindow does not have a "make it scrollable but
do not draw scrollbars" mode, because it assumes the widget does not
scroll by itself - so when you set the policy to NEVER you are
essentially telling it to respect the widget's size request. GTK+ 2
widgets request as big a size as is required for the whole of the
contents to be shown, which in this case is the full size of the page
contents.

You can enforce a size on the widget by overriding the size request:

http://developer.gnome.org/gtk/stable/GtkWidget.html#GtkWidget-size-request

Or by setting the allocation explicitly when handling the size-allocate
signal:

http://developer.gnome.org/gtk/stable/GtkWidget.html#gtk-widget-set-allocation

This is not specific to WebKitGTK+, it's also how GtkTextView works. In
GTK+ 3 the sizing story has been improved a bit, so the "size request"
concept has been split in two: a natural size (which would be the same
as current's size-request) and a "minimum size", which would enforce a
size on non-scrolling containers. More info on size request/allocation
negotiation here:

http://developer.gnome.org/gtk/stable/GtkContainer.html

I asked if the problem was in a specific page because even after you've
done all of the above, some pages will still display scrollbars, like
gmail, because it uses tricks to make the contents be the size of the
browser's viewport and then uses html structures to create the
scrollable part.

Cheers,

-- 
Gustavo Noronha Silva 
GNOME Project

___
webkit-gtk mailing list
webkit-gtk@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk


Re: [webkit-gtk] GtkLauncher scrolling problem

2011-05-24 Thread Brendan Taylor
On Tue, May 24, 2011 at 11:57:56AM +0200, Maxime de Roucy wrote:
> If I handle the signal and set the gtkscrolledwindow policy to
> GTK_POLICY_NEVER. The scrollbar does appear but the window is
> automatically resized by the webkit webview to fit the whole web page.
> Which isn't what I want.
> 
> So : It seams it is now impossible to use webkit without a scrollbar.

We're experiencing this too, it's quite annoying. We first noticed it 
when migrating to GTK3, but seems to occur on GTK2 as well in some 
cases.

This bug has a gtklauncher-based demo of the problem:
https://bugs.webkit.org/show_bug.cgi?id=59197
___
webkit-gtk mailing list
webkit-gtk@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk


Re: [webkit-gtk] GtkLauncher scrolling problem

2011-05-24 Thread Maxime de Roucy
Le Tue, 24 May 2011 10:31:40 +1200,
"Gavin Lambert"  a écrit :

> Quoth Maxime de Roucy:
> >  * Signal emitted when policy for one or both of the scrollbars
> > of
> >  * the view has changed. The default handler will apply the new
> >  * policy to the container that holds the #WebKitWebFrame if it
> > is
> >  * a #GtkScrolledWindow and the frame is the main frame. If you
> > do
> >  * not want this to be handled automatically, you need to handle
> >  * this signal.
> [...]
> > So it seams it is now impossible to use webkit without a scrollbar.
> 
> Did you try handling that signal, like it says?
> 
> 

Yes I tried, but as the it said :
* The exception to this rule is that policies to disable the
* scrollbars are applied as %GTK_POLICY_AUTOMATIC instead, since
* the size request of the widget would force browser windows to
* not be resizable.

So if I handle the signal and set the gtkscrolledwindow policy to
GTK_POLICY_AUTOMATIC. The result is the same, scrollbar appear :
They are GTK scrollbars, not webkit, but their is no difference for the
end user (for what I saw).

If I handle the signal and set the gtkscrolledwindow policy to
GTK_POLICY_NEVER. The scrollbar does appear but the window is
automatically resized by the webkit webview to fit the whole web page.
Which isn't what I want.

So : It seams it is now impossible to use webkit without a scrollbar.


signature.asc
Description: PGP signature
___
webkit-gtk mailing list
webkit-gtk@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk


Re: [webkit-gtk] GtkLauncher scrolling problem

2011-05-23 Thread Gavin Lambert
Quoth Maxime de Roucy:
>  * Signal emitted when policy for one or both of the scrollbars of
>  * the view has changed. The default handler will apply the new
>  * policy to the container that holds the #WebKitWebFrame if it is
>  * a #GtkScrolledWindow and the frame is the main frame. If you do
>  * not want this to be handled automatically, you need to handle
>  * this signal.
[...]
> So it seams it is now impossible to use webkit without a scrollbar.

Did you try handling that signal, like it says?


___
webkit-gtk mailing list
webkit-gtk@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk


Re: [webkit-gtk] GtkLauncher scrolling problem

2011-05-23 Thread Maxime de Roucy
Le Mon, 23 May 2011 14:37:04 -0300,
Gustavo Noronha Silva  a écrit :

> Hey,
> 
> On Sun, 2011-05-22 at 12:39 +0200, Maxime de Roucy wrote:
> > I try GtkLauncher and modify the l 124 :
> > gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow),
> > GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); by
> > gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow),
> > GTK_POLICY_NEVER, GTK_POLICY_NEVER);
> > 
> > But it doesn't change anything. I still have scroll bar in the
> > window.
> > 
> > Is it a bug ?
> 
> Is that on a specific page?
> 
> Cheers,
> 

No it doesn't append on a spécifique page (but the page have to be long
enough to make the scrollbar appear).

But I found the reason line 264 of
Source/WebKit/gtk/webkit/webkitwebframe.cpp file.

WebKitWebFrame::scrollbars-policy-changed:
 * @web_view: the object which received the signal
 *
 * Signal emitted when policy for one or both of the scrollbars of
 * the view has changed. The default handler will apply the new
 * policy to the container that holds the #WebKitWebFrame if it is
 * a #GtkScrolledWindow and the frame is the main frame. If you do
 * not want this to be handled automatically, you need to handle
 * this signal.
 *
 * The exception to this rule is that policies to disable the
 * scrollbars are applied as %GTK_POLICY_AUTOMATIC instead, since
 * the size request of the widget would force browser windows to
 * not be resizable.
 *
 * You can obtain the new policies from the
 * WebKitWebFrame:horizontal-scrollbar-policy and
 * WebKitWebFrame:vertical-scrollbar-policy properties.
 *
 * Return value: %TRUE to stop other handlers from being invoked
for the
 * event. %FALSE to propagate the event further.
 *
 * Since: 1.1.14

So it seams it is now impossible to use webkit without a scrollbar.

Am I right ?

Thanks


signature.asc
Description: PGP signature
___
webkit-gtk mailing list
webkit-gtk@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk


Re: [webkit-gtk] GtkLauncher scrolling problem

2011-05-23 Thread Gustavo Noronha Silva
Hey,

On Sun, 2011-05-22 at 12:39 +0200, Maxime de Roucy wrote:
> I try GtkLauncher and modify the l 124 :
> gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow), 
> GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
> by
> gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow), 
> GTK_POLICY_NEVER, GTK_POLICY_NEVER);
> 
> But it doesn't change anything. I still have scroll bar in the window.
> 
> Is it a bug ?

Is that on a specific page?

Cheers,

-- 
Gustavo Noronha Silva 
GNOME Project

___
webkit-gtk mailing list
webkit-gtk@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk


[webkit-gtk] GtkLauncher scrolling problem

2011-05-22 Thread Maxime de Roucy
Hello

Hello, I am trying webkitgtk-1.4.0, I am on archlinux and installed
libwebkit3 (which correspond to webkitGtk 1.4.0).

I try GtkLauncher and modify the l 124 :
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow), 
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
by
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow), 
GTK_POLICY_NEVER, GTK_POLICY_NEVER);

But it doesn't change anything. I still have scroll bar in the window.

Is it a bug ?

Thanks in advance.


signature.asc
Description: PGP signature
___
webkit-gtk mailing list
webkit-gtk@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk