Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Issue 149548: Make GTK file dialog box modal for parent window, instead of for the entire... (Closed)

Created:
11 years, 5 months ago by Mohit Muthanna Cheppudira
Modified:
9 years, 7 months ago
Reviewers:
Evan Martin, Evan Stade
CC:
chromium-reviews_googlegroups.com, Ben Goodger (Google)
Visibility:
Public.

Description

Make GTK file dialog box modal for parent window, instead of for the entire application. This works by adding the GtkWindow in BrowserWindowGtk to its own GtkWindowGroup and adding the SelectFile dialog to the same group. The following call to gtk_grab_add(...) makes the SelectFile dialog modal, but only to the windows within the same group. Similarly, the bookmark manager window is also added to its own unique GtkWindowGroup, so the import/export dialogs behave correctly. If I'm understanding things correctly, the GtkWindowGroup objects are reference counted once the have windows attached to them, and will delete themselves after all references to them are destroyed. I'm not sure how to verify this. Test: - Open two new chrome window: A and B - Open "Save file as..." dialog in window A - Verify that window A does not respond to keyboard or mouse events. - Verify that window B does responde to keyboard and mouse events. - Open "Save file as..." dialog in window B - Verify that window B does not respond to keyboard or mouse events. - Cancel dialog on window A. - Verify that window A starts responding to keyboard and mouse events. - Cancel dialog on window B. - Verify that window B starts responding to keyboard and mouse events. Test 2: - Verify that <select> tag allows for correct selection of items. Test 3: - Click bookmark star and verify that info bubble works correctly. BUG=8727 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=20667

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 1

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -6 lines) Patch
M chrome/browser/gtk/bookmark_manager_gtk.cc View 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/gtk/browser_window_gtk.cc View 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/gtk/dialogs_gtk.cc View 1 2 3 4 5 6 2 chunks +7 lines, -5 lines 1 comment Download
M chrome/browser/gtk/info_bubble_gtk.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_gtk.cc View 7 8 1 chunk +6 lines, -1 line 0 comments Download

Messages

Total messages: 40 (0 generated)
tony
11 years, 5 months ago (2009-07-13 17:58:26 UTC) #1
tony
Adding some reviewers so someone will look at this patch. In the future, try svn ...
11 years, 5 months ago (2009-07-13 18:00:34 UTC) #2
Evan Martin
I don't believe this actually works. Setting transient_for just is a hint to the window ...
11 years, 5 months ago (2009-07-13 18:00:55 UTC) #3
mohit_muthanna.com
Yep, I can open the dialog with one window, and interact with other windows. (This ...
11 years, 5 months ago (2009-07-13 18:05:21 UTC) #4
Evan Martin
No, my question is whether it properly blocks interaction with its parent window. (That is, ...
11 years, 5 months ago (2009-07-13 18:05:53 UTC) #5
mohit_muthanna.com
Ah, I see. I'll test that and get back to you shortly. On Jul 13, ...
11 years, 5 months ago (2009-07-13 18:14:37 UTC) #6
Mohit Muthanna Cheppudira
Okay, I just tested this and it does block interaction with it's parent window. From ...
11 years, 5 months ago (2009-07-13 18:38:00 UTC) #7
Evan Martin
Sorry to be so skeptical, but I could swear that gtk_window_set_modal exists for a reason. ...
11 years, 5 months ago (2009-07-13 19:30:10 UTC) #8
Mohit Muthanna Cheppudira
Turns out your skepticism is not unfounded. This case does fail. :-( I was only ...
11 years, 5 months ago (2009-07-13 19:39:39 UTC) #9
Mohit Muthanna Cheppudira
I researched this a bit more and found that the right way to do this ...
11 years, 5 months ago (2009-07-13 20:40:46 UTC) #10
Evan Stade
On 2009/07/13 20:40:46, Mohit Muthanna Cheppudira wrote: > I researched this a bit more and ...
11 years, 5 months ago (2009-07-13 20:42:38 UTC) #11
Evan Martin
Note, from the original bug, that GtkWindowGroup isn't available on the system we're targeting. We ...
11 years, 5 months ago (2009-07-13 20:43:02 UTC) #12
Mohit Muthanna Cheppudira
It seems that GtkWindowGroup has been available since 2.4. I have it working on my ...
11 years, 5 months ago (2009-07-13 21:07:23 UTC) #13
Mohit Muthanna Cheppudira
Okay, pkg-config tells me that I have version 2.12.9: $ pkg-config --modversion gtk+-x11-2.0 2.12.9 Since ...
11 years, 5 months ago (2009-07-13 21:24:16 UTC) #14
Evan Martin
Huh, maybe the GTK docs were wrong! % objdump -T /usr/lib32/libgtk-x11-2.0.so.0.1200.9 | grep gtk_window_group 00279a70 ...
11 years, 5 months ago (2009-07-13 21:25:20 UTC) #15
Evan Martin
I think estade should review. I think we maybe don't want to create a new ...
11 years, 5 months ago (2009-07-13 21:26:29 UTC) #16
Mohit Muthanna Cheppudira
On Mon, Jul 13, 2009 at 5:26 PM, <evan@chromium.org> wrote: > I think estade should ...
11 years, 5 months ago (2009-07-13 21:32:09 UTC) #17
Evan Stade
whaddayaknow I suspect Evan is right and that window group is leaking. GtkWindowGroups are not ...
11 years, 5 months ago (2009-07-13 21:42:54 UTC) #18
Mohit Muthanna Cheppudira
On Mon, Jul 13, 2009 at 5:42 PM, <estade@chromium.org> wrote: > whaddayaknow > > I ...
11 years, 5 months ago (2009-07-13 21:52:44 UTC) #19
Mohit Muthanna Cheppudira
On Mon, Jul 13, 2009 at 5:52 PM, Mohit Muthanna <mohit.muthanna@gmail.com>wrote: > > > On ...
11 years, 5 months ago (2009-07-14 01:10:02 UTC) #20
Evan Martin
On 2009/07/14 01:10:02, Mohit Muthanna Cheppudira wrote: > I went through the code in gtkwindow.c, ...
11 years, 5 months ago (2009-07-14 01:13:25 UTC) #21
Mohit Muthanna Cheppudira
On Mon, Jul 13, 2009 at 9:13 PM, <evan@chromium.org> wrote: > On 2009/07/14 01:10:02, Mohit ...
11 years, 5 months ago (2009-07-14 01:24:51 UTC) #22
Evan Stade
simply unref the group right after you set it gtk_window_group_add_window(gtk_window_group_new(), window_); g_object_unref(gtk_window_get_group(window_));
11 years, 5 months ago (2009-07-14 01:30:07 UTC) #23
Mohit Muthanna Cheppudira
On Mon, Jul 13, 2009 at 9:24 PM, Mohit Muthanna <mohit.muthanna@gmail.com>wrote: > On Mon, Jul ...
11 years, 5 months ago (2009-07-14 01:31:10 UTC) #24
Mohit Muthanna Cheppudira
On Mon, Jul 13, 2009 at 9:30 PM, <estade@chromium.org> wrote: > simply unref the group ...
11 years, 5 months ago (2009-07-14 01:32:13 UTC) #25
Mohit Muthanna Cheppudira
Done and tested. PTAL. On Mon, Jul 13, 2009 at 9:31 PM, Mohit Muthanna <mohit.muthanna@gmail.com>wrote: ...
11 years, 5 months ago (2009-07-14 15:44:43 UTC) #26
Evan Stade
lgtm, barring objections from Evan M. I will commit this.
11 years, 5 months ago (2009-07-14 18:41:45 UTC) #27
Evan Martin
I am a little scared of gtk_grab_add -- I hope the grab is released on ...
11 years, 5 months ago (2009-07-14 18:46:20 UTC) #28
Mohit Muthanna Cheppudira
On Tue, Jul 14, 2009 at 2:46 PM, <evan@chromium.org> wrote: > I am a little ...
11 years, 5 months ago (2009-07-14 18:54:41 UTC) #29
Mohit Muthanna Cheppudira
Thanks for the review. I'm happy to look at other modality issues in GTK. I ...
11 years, 5 months ago (2009-07-14 19:14:08 UTC) #30
Evan Stade
I reverted this change as it broke dropdown menus. I suspect it will break us ...
11 years, 5 months ago (2009-07-15 04:25:00 UTC) #31
Mohit Muthanna Cheppudira
On Wed, Jul 15, 2009 at 12:25 AM, <estade@chromium.org> wrote: > I reverted this change ...
11 years, 5 months ago (2009-07-15 12:14:38 UTC) #32
Mohit Muthanna Cheppudira
On Wed, Jul 15, 2009 at 8:13 AM, Mohit Muthanna <mohit.muthanna@gmail.com>wrote: > On Wed, Jul ...
11 years, 5 months ago (2009-07-15 15:18:41 UTC) #33
Evan Stade
On Wed, Jul 15, 2009 at 3:18 PM, Mohit Muthanna<mohit.muthanna@gmail.com> w= rote: > On Wed, ...
11 years, 5 months ago (2009-07-15 18:36:26 UTC) #34
mohit_muthanna.com
Okay, this is going to be tricky. Using gtk_window_set_modal() on the dialog does not fix ...
11 years, 5 months ago (2009-07-18 15:56:25 UTC) #35
Evan Stade
You can add the dropdown window (which is a popup, a particular kind of GtkWindow---see ...
11 years, 5 months ago (2009-07-19 07:01:54 UTC) #36
Mohit Muthanna Cheppudira
Thanks for the pointer. I'll go through that doc and ping you if I have ...
11 years, 5 months ago (2009-07-19 13:30:10 UTC) #37
Mohit Muthanna Cheppudira
Okay, all done. - Added the popup from RenderWidgetHostViewGtk::InitAsPopup() to the browser's window group. - ...
11 years, 5 months ago (2009-07-20 22:46:20 UTC) #38
Evan Martin
http://codereview.chromium.org/149548/diff/1054/2021 File chrome/browser/gtk/dialogs_gtk.cc (right): http://codereview.chromium.org/149548/diff/1054/2021#newcode209 Line 209: // group as the parent, and calling gtk_grab_add(...) ...
11 years, 5 months ago (2009-07-20 22:49:17 UTC) #39
Evan Stade
11 years, 5 months ago (2009-07-20 22:51:07 UTC) #40
can you open a new issue with this patch please?

Powered by Google App Engine
This is Rietveld 408576698