| Differences between
and this patch
- Source/WebCore/ChangeLog +21 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2014-09-16  Zan Dobersek  <zdobersek@igalia.com>
2
3
        [GTK] Add a helper function for display system deduction
4
        https://bugs.webkit.org/show_bug.cgi?id=136849
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        getDisplaySystemType() is a helper function that checks the type of the
9
        default GdkDisplay object and initializes a static variable to the
10
        corresponding value. It then returns the value of that variable.
11
12
        When building with the GTK+2 API (still the case with the GTK+2 plugin
13
        process) we default to X11.
14
15
        The function is declared and implemented in GtkUtilities files.
16
17
        * platform/gtk/GtkUtilities.cpp:
18
        (WebCore::widgetIsOnscreenToplevelWindow):
19
        (WebCore::getDisplaySystemType):
20
        * platform/gtk/GtkUtilities.h:
21
1
2014-09-16  Enrica Casucci  <enrica@apple.com>
22
2014-09-16  Enrica Casucci  <enrica@apple.com>
2
23
3
        Move HTMLConverter from editing/cocoa to platform/cocoa.
24
        Move HTMLConverter from editing/cocoa to platform/cocoa.
- Source/WebCore/platform/gtk/GtkUtilities.cpp +29 lines
Lines 22-27 Source/WebCore/platform/gtk/GtkUtilities.cpp_sec1
22
#include "IntPoint.h"
22
#include "IntPoint.h"
23
#include <gtk/gtk.h>
23
#include <gtk/gtk.h>
24
24
25
#if PLATFORM(X11)
26
#include <gdk/gdkx.h>
27
#endif
28
#if PLATFORM(WAYLAND) && !defined(GTK_API_VERSION_2)
29
#include <gdk/gdkwayland.h>
30
#endif
31
25
namespace WebCore {
32
namespace WebCore {
26
33
27
IntPoint convertWidgetPointToScreenPoint(GtkWidget* widget, const IntPoint& point)
34
IntPoint convertWidgetPointToScreenPoint(GtkWidget* widget, const IntPoint& point)
Lines 52-55 bool widgetIsOnscreenToplevelWindow(GtkW Source/WebCore/platform/gtk/GtkUtilities.cpp_sec2
52
    return gtk_widget_is_toplevel(widget) && GTK_IS_WINDOW(widget) && !GTK_IS_OFFSCREEN_WINDOW(widget);
59
    return gtk_widget_is_toplevel(widget) && GTK_IS_WINDOW(widget) && !GTK_IS_OFFSCREEN_WINDOW(widget);
53
}
60
}
54
61
62
DisplaySystemType getDisplaySystemType()
63
{
64
#if defined(GTK_API_VERSION_2)
65
    return DisplaySystemType::X11;
66
#else
67
    static DisplaySystemType type = [] {
68
        GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
69
#if PLATFORM(X11)
70
        if (GDK_IS_X11_DISPLAY(display))
71
            return DisplaySystemType::X11;
72
#endif
73
#if PLATFORM(WAYLAND)
74
        if (GDK_IS_WAYLAND_DISPLAY(display))
75
            return DisplaySystemType::Wayland;
76
#endif
77
        ASSERT_NOT_REACHED();
78
        return DisplaySystemType::X11;
79
    }();
80
    return type;
81
#endif
82
}
83
55
} // namespace WebCore
84
} // namespace WebCore
- Source/WebCore/platform/gtk/GtkUtilities.h +7 lines
Lines 26-31 class IntPoint; Source/WebCore/platform/gtk/GtkUtilities.h_sec1
26
IntPoint convertWidgetPointToScreenPoint(GtkWidget*, const IntPoint&);
26
IntPoint convertWidgetPointToScreenPoint(GtkWidget*, const IntPoint&);
27
bool widgetIsOnscreenToplevelWindow(GtkWidget*);
27
bool widgetIsOnscreenToplevelWindow(GtkWidget*);
28
28
29
enum class DisplaySystemType {
30
    X11,
31
    Wayland
32
};
33
34
DisplaySystemType getDisplaySystemType();
35
29
} // namespace WebCore
36
} // namespace WebCore
30
37
31
#endif // GtkUtilities_h
38
#endif // GtkUtilities_h

Return to Bug 136849