зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 91a43fa9b0da
--HG-- extra : rebase_source : 00ee0eac778112a8aac3e19f1f114e8b8b34580c
This commit is contained in:
Родитель
684e89e487
Коммит
95a6a24425
|
@ -87,7 +87,7 @@ include $(topsrcdir)/config/rules.mk
|
|||
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
|
||||
CXXFLAGS += $(MOZ_GTK2_CFLAGS)
|
||||
CFLAGS += $(MOZ_GTK2_CFLAGS)
|
||||
EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) $(XLDFLAGS) $(XLIBS) $(XEXT_LIBS)
|
||||
EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) $(XLDFLAGS) $(XLIBS)
|
||||
endif
|
||||
|
||||
install-plugin: $(SHARED_LIBRARY)
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include <gdk/gdk.h>
|
||||
#ifdef MOZ_X11
|
||||
#include <gdk/gdkx.h>
|
||||
#include <X11/extensions/shape.h>
|
||||
#endif
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
@ -335,34 +334,6 @@ int32_t pluginGetEdge(InstanceData* instanceData, RectEdge edge)
|
|||
return NPTEST_INT32_ERROR;
|
||||
}
|
||||
|
||||
#ifdef MOZ_X11
|
||||
static void intersectWithShapeRects(Display* display, Window window,
|
||||
int kind, GdkRegion* region)
|
||||
{
|
||||
int count, order;
|
||||
XRectangle* shapeRects =
|
||||
XShapeGetRectangles(display, window, kind, &count, &order);
|
||||
if (!shapeRects)
|
||||
return;
|
||||
|
||||
GdkRegion* shapeRegion = gdk_region_new();
|
||||
if (!shapeRegion) {
|
||||
XFree(shapeRects);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < count; ++i) {
|
||||
XRectangle* r = &shapeRects[i];
|
||||
GdkRectangle rect = { r->x, r->y, r->width, r->height };
|
||||
gdk_region_union_with_rect(shapeRegion, &rect);
|
||||
}
|
||||
XFree(shapeRects);
|
||||
|
||||
gdk_region_intersect(region, shapeRegion);
|
||||
gdk_region_destroy(shapeRegion);
|
||||
}
|
||||
#endif
|
||||
|
||||
static GdkRegion* computeClipRegion(InstanceData* instanceData)
|
||||
{
|
||||
if (!instanceData->hasWidget)
|
||||
|
@ -403,15 +374,13 @@ static GdkRegion* computeClipRegion(InstanceData* instanceData)
|
|||
return 0;
|
||||
}
|
||||
|
||||
GdkRectangle windowRect = { 0, 0, width, height };
|
||||
GdkRectangle windowRect = { -pluginX, -pluginY, width, height };
|
||||
GdkRegion* windowRgn = gdk_region_rectangle(&windowRect);
|
||||
if (!windowRgn) {
|
||||
gdk_region_destroy(region);
|
||||
return 0;
|
||||
}
|
||||
intersectWithShapeRects(display, window, ShapeBounding, windowRgn);
|
||||
intersectWithShapeRects(display, window, ShapeClip, windowRgn);
|
||||
gdk_region_offset(windowRgn, -pluginX, -pluginY);
|
||||
gdk_region_intersect(region, windowRgn);
|
||||
gdk_region_destroy(windowRgn);
|
||||
|
||||
// Stop now if we've reached the toplevel. Stopping here means
|
||||
|
|
Загрузка…
Ссылка в новой задаче