Changeset 206072 in webkit
- Timestamp:
- Sep 17, 2016 3:52:16 AM (8 years ago)
- Location:
- releases/WebKitGTK/webkit-2.14/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.14/Source/WebKit2/ChangeLog
r206071 r206072 1 2016-09-17 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Move the rendering of auth dialog shadow to the auth dialog widget 4 https://bugs.webkit.org/show_bug.cgi?id=162061 5 6 Reviewed by Michael Catanzaro. 7 8 Instead of rendering the shadow in the web view, we can let the auth dialog do it. This fixes the rendering of 9 the shadow in Wayland when using gdk_cairo_draw_from_gl(). 10 11 * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp: 12 (webkitAuthenticationDialogDraw): Draw the shadow before rendering the child. 13 (webkitAuthenticationDialogSizeAllocate): Center the child on the allocated space. 14 (webkit_authentication_dialog_class_init): Add size_allocate implementation. 15 * UIProcess/API/gtk/WebKitWebViewBase.cpp: 16 (webkitWebViewBaseDraw): Do not draw the shadow when auth dialog is present. 17 (webkitWebViewBaseSizeAllocate): Give the whole web view allocation to the auth dialog. 18 1 19 2016-09-17 Carlos Garcia Campos <cgarcia@igalia.com> 2 20 -
releases/WebKitGTK/webkit-2.14/Source/WebKit2/UIProcess/API/gtk/WebKitAuthenticationDialog.cpp
r190413 r206072 205 205 WebKitAuthenticationDialogPrivate* priv = WEBKIT_AUTHENTICATION_DIALOG(widget)->priv; 206 206 207 gtk_style_context_save(priv->styleContext.get()); 208 gtk_style_context_add_class(priv->styleContext.get(), GTK_STYLE_CLASS_BACKGROUND); 209 gtk_render_background(priv->styleContext.get(), cr, 0, 0, gtk_widget_get_allocated_width(widget), gtk_widget_get_allocated_height(widget)); 210 gtk_style_context_restore(priv->styleContext.get()); 207 cairo_set_operator(cr, CAIRO_OPERATOR_OVER); 208 cairo_set_source_rgba(cr, 0, 0, 0, 0.5); 209 cairo_paint(cr); 210 211 if (GtkWidget* child = gtk_bin_get_child(GTK_BIN(widget))) { 212 GtkAllocation allocation; 213 gtk_widget_get_allocation(child, &allocation); 214 215 gtk_style_context_save(priv->styleContext.get()); 216 gtk_style_context_add_class(priv->styleContext.get(), GTK_STYLE_CLASS_BACKGROUND); 217 gtk_render_background(priv->styleContext.get(), cr, allocation.x, allocation.y, allocation.width, allocation.height); 218 gtk_style_context_restore(priv->styleContext.get()); 219 } 211 220 212 221 GTK_WIDGET_CLASS(webkit_authentication_dialog_parent_class)->draw(widget, cr); … … 221 230 222 231 GTK_WIDGET_CLASS(webkit_authentication_dialog_parent_class)->map(widget); 232 } 233 234 static void webkitAuthenticationDialogSizeAllocate(GtkWidget* widget, GtkAllocation* allocation) 235 { 236 GTK_WIDGET_CLASS(webkit_authentication_dialog_parent_class)->size_allocate(widget, allocation); 237 238 GtkWidget* child = gtk_bin_get_child(GTK_BIN(widget)); 239 if (!child) 240 return; 241 242 GtkRequisition naturalSize; 243 gtk_widget_get_preferred_size(child, 0, &naturalSize); 244 245 GtkAllocation childAllocation; 246 gtk_widget_get_allocation(child, &childAllocation); 247 248 childAllocation.x += (allocation->width - naturalSize.width) / 2; 249 childAllocation.y += (allocation->height - naturalSize.height) / 2; 250 childAllocation.width = naturalSize.width; 251 childAllocation.height = naturalSize.height; 252 gtk_widget_size_allocate(child, &childAllocation); 223 253 } 224 254 … … 255 285 widgetClass->draw = webkitAuthenticationDialogDraw; 256 286 widgetClass->map = webkitAuthenticationDialogMap; 287 widgetClass->size_allocate = webkitAuthenticationDialogSizeAllocate; 257 288 } 258 289 -
releases/WebKitGTK/webkit-2.14/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
r205587 r206072 543 543 } 544 544 545 if (webViewBase->priv->authenticationDialog) {546 cairo_set_operator(cr, CAIRO_OPERATOR_OVER);547 cairo_set_source_rgba(cr, 0, 0, 0, 0.5);548 cairo_paint(cr);549 }550 551 545 GTK_WIDGET_CLASS(webkit_web_view_base_parent_class)->draw(widget, cr); 552 546 … … 603 597 // after calculating the inspector allocation. 604 598 if (priv->authenticationDialog) { 605 GtkRequisition naturalSize; 606 gtk_widget_get_preferred_size(priv->authenticationDialog, 0, &naturalSize); 607 608 GtkAllocation childAllocation = { 609 (viewRect.width() - naturalSize.width) / 2, 610 (viewRect.height() - naturalSize.height) / 2, 611 naturalSize.width, 612 naturalSize.height 613 }; 599 GtkRequisition minimumSize; 600 gtk_widget_get_preferred_size(priv->authenticationDialog, &minimumSize, nullptr); 601 602 GtkAllocation childAllocation = { 0, 0, std::max(minimumSize.width, viewRect.width()), std::max(minimumSize.height, viewRect.height()) }; 614 603 gtk_widget_size_allocate(priv->authenticationDialog, &childAllocation); 615 604 }
Note: See TracChangeset
for help on using the changeset viewer.