Bug 124671

Summary: [GTK] Cannot scroll in option menu when it larger than the screen
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: csaavedra
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch mrobinson: review+

Description Carlos Garcia Campos 2013-11-20 10:53:29 PST
The problem is that the popup menu is not resized to fit in the screen, so it doesn't scroll and some of the items are offscreen so they can't be selected either.
Comment 1 Carlos Garcia Campos 2013-11-20 10:58:57 PST
Created attachment 217458 [details]
Patch
Comment 2 Martin Robinson 2013-11-20 11:05:07 PST
Comment on attachment 217458 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=217458&action=review

> Source/WebCore/platform/gtk/GtkPopupMenu.cpp:95
> +        for (i = 0, child = children.get(); i < itemCount; i++, child = g_list_next(child)) {

I think that if you declare i and child here they will be scoped properly. For instance:

for (int i = 0, GList* child = children.get();...

> Source/WebCore/platform/gtk/GtkPopupMenu.cpp:114
> +    guint button = event && event->type == GDK_BUTTON_PRESS ? event->button.button : 1;
> +    guint32 activateTime = event ? gdk_event_get_time(event) : GDK_CURRENT_TIME;

Nice cleanup.
Comment 3 Carlos Garcia Campos 2013-11-20 11:13:55 PST
(In reply to comment #2)
> (From update of attachment 217458 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=217458&action=review
> 
> > Source/WebCore/platform/gtk/GtkPopupMenu.cpp:95
> > +        for (i = 0, child = children.get(); i < itemCount; i++, child = g_list_next(child)) {
> 
> I think that if you declare i and child here they will be scoped properly. For instance:
> 
> for (int i = 0, GList* child = children.get();...

Yes, that would be really great, but it doesn't work :-(

> > Source/WebCore/platform/gtk/GtkPopupMenu.cpp:114
> > +    guint button = event && event->type == GDK_BUTTON_PRESS ? event->button.button : 1;
> > +    guint32 activateTime = event ? gdk_event_get_time(event) : GDK_CURRENT_TIME;
> 
> Nice cleanup.

Thanks.
Comment 4 Carlos Garcia Campos 2013-11-20 11:17:28 PST
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 217458 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=217458&action=review
> > 
> > > Source/WebCore/platform/gtk/GtkPopupMenu.cpp:95
> > > +        for (i = 0, child = children.get(); i < itemCount; i++, child = g_list_next(child)) {
> > 
> > I think that if you declare i and child here they will be scoped properly. For instance:
> > 
> > for (int i = 0, GList* child = children.get();...
> 
> Yes, that would be really great, but it doesn't work :-(

I've tried again to be sure, and this is what I got:

  CXX      Source/WebCore/platform/gtk/libPlatformGtk_la-GtkPopupMenu.lo
../../Source/WebCore/platform/gtk/GtkPopupMenu.cpp: In member function 'void WebCore::GtkPopupMenu::popUp(const WebCore::IntSize&, const WebCore::IntPoint&, int, int, const GdkEvent*)':
../../Source/WebCore/platform/gtk/GtkPopupMenu.cpp:95:30: error: expected initializer before '*' token
../../Source/WebCore/platform/gtk/GtkPopupMenu.cpp:95:30: error: expected ';' before '*' token
../../Source/WebCore/platform/gtk/GtkPopupMenu.cpp:95:32: error: 'child' was not declared in this scope
../../Source/WebCore/platform/gtk/GtkPopupMenu.cpp:95:58: warning: for increment expression has no effect [-Wunused-value]
../../Source/WebCore/platform/gtk/GtkPopupMenu.cpp:95:69: error: expected ')' before ';' token
../../Source/WebCore/platform/gtk/GtkPopupMenu.cpp:95:71: error: 'i' was not declared in this scope
../../Source/WebCore/platform/gtk/GtkPopupMenu.cpp:95:76: error: 'child' was not declared in this scope
../../Source/WebCore/platform/gtk/GtkPopupMenu.cpp:95:131: error: expected ';' before ')' token
Comment 5 Carlos Garcia Campos 2013-11-21 00:50:24 PST
Committed r159615: <http://trac.webkit.org/changeset/159615>
Comment 6 Carlos Garcia Campos 2013-11-26 06:32:24 PST
*** Bug 97106 has been marked as a duplicate of this bug. ***