Bug 124671 - [GTK] Cannot scroll in option menu when it larger than the screen
: [GTK] Cannot scroll in option menu when it larger than the screen
Status: RESOLVED FIXED
Product: WebKit
Classification: Unclassified
Component: WebKit Gtk
: 528+ (Nightly build)
: Unspecified Unspecified
: P2 Normal
Assigned To: Nobody
: Gtk
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-20 10:53 PST by Carlos Garcia Campos
Modified: 2013-11-26 06:32 PST (History)
1 user (show)

See Also:


Attachments
Patch (3.86 KB, patch)
2013-11-20 10:58 PST, Carlos Garcia Campos
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***