Commit d3ad6425 authored by Matthias Clasen's avatar Matthias Clasen

Deprecate more to-be-removed screen apis

These will be removed in GTK+ 4, therefore, we're deprecating
them now.
parent 61fc7ddd
......@@ -162,8 +162,10 @@ gdk_app_launch_context_get_display (GAppLaunchContext *context,
GdkAppLaunchContext *ctx = GDK_APP_LAUNCH_CONTEXT (context);
GdkDisplay *display;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (ctx->screen)
return gdk_screen_make_display_name (ctx->screen);
G_GNUC_END_IGNORE_DEPRECATIONS
if (ctx->display)
display = ctx->display;
......
......@@ -1708,6 +1708,7 @@ _gdk_device_translate_window_coord (GdkDevice *device,
device_width = axis_info_x->max_value - axis_info_x->min_value;
device_height = axis_info_y->max_value - axis_info_y->min_value;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (device_width > 0)
x_min = axis_info_x->min_value;
else
......@@ -1723,6 +1724,7 @@ _gdk_device_translate_window_coord (GdkDevice *device,
device_height = gdk_screen_get_height (gdk_window_get_screen (window));
y_min = 0;
}
G_GNUC_END_IGNORE_DEPRECATIONS
window_width = gdk_window_get_width (window);
window_height = gdk_window_get_height (window);
......@@ -1805,6 +1807,7 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
axis_width = axis_info.max_value - axis_info.min_value;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (axis_info.use == GDK_AXIS_X)
{
if (axis_width > 0)
......@@ -1823,6 +1826,7 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
offset = - window_root_y - window->abs_y;
}
G_GNUC_END_IGNORE_DEPRECATIONS
if (axis_value)
*axis_value = offset + scale * (value - axis_info.min_value);
......
......@@ -2553,12 +2553,14 @@ get_fallback_monitor (GdkDisplay *display)
}
screen = gdk_display_get_default_screen (display);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gdk_monitor_set_size (monitor,
gdk_screen_get_width (screen),
gdk_screen_get_height (screen));
gdk_monitor_set_physical_size (monitor,
gdk_screen_get_width_mm (screen),
gdk_screen_get_height_mm (screen));
G_GNUC_END_IGNORE_DEPRECATIONS
return monitor;
}
......
......@@ -104,14 +104,14 @@ GDK_DEPRECATED_IN_3_0_FOR(gdk_display_device_is_grabbed)
gboolean gdk_pointer_is_grabbed (void);
#endif /* GDK_MULTIDEVICE_SAFE */
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_22
gint gdk_screen_width (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_22
gint gdk_screen_height (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_22
gint gdk_screen_width_mm (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_22
gint gdk_screen_height_mm (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
......
......@@ -279,11 +279,15 @@ gdk_screen_get_monitor_at_window (GdkScreen *screen,
* gdk_screen_get_monitor_scale_factor()).
*
* Returns: the width of the default screen in pixels.
*
* Deprecated: 3.22: Use per-monitor information
**/
gint
gdk_screen_width (void)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
return gdk_screen_get_width (gdk_screen_get_default ());
G_GNUC_END_IGNORE_DEPRECATIONS
}
/**
......@@ -294,11 +298,15 @@ gdk_screen_width (void)
* gdk_screen_get_monitor_scale_factor()).
*
* Returns: the height of the default screen in pixels.
*
* Deprecated: 3.22: Use per-monitor information
**/
gint
gdk_screen_height (void)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
return gdk_screen_get_height (gdk_screen_get_default ());
G_GNUC_END_IGNORE_DEPRECATIONS
}
/**
......@@ -309,11 +317,15 @@ gdk_screen_height (void)
*
* Returns: the width of the default screen in millimeters,
* though it is not always correct.
*
* Deprecated: 3.22: Use per-monitor information
**/
gint
gdk_screen_width_mm (void)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
return gdk_screen_get_width_mm (gdk_screen_get_default ());
G_GNUC_END_IGNORE_DEPRECATIONS
}
/**
......@@ -324,11 +336,15 @@ gdk_screen_width_mm (void)
*
* Returns: the height of the default screen in millimeters,
* though it is not always correct.
*
* Deprecated: 3.22: Use per-monitor information
**/
gint
gdk_screen_height_mm (void)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
return gdk_screen_get_height_mm (gdk_screen_get_default ());
G_GNUC_END_IGNORE_DEPRECATIONS
}
/**
......@@ -533,6 +549,8 @@ gdk_screen_get_display (GdkScreen *screen)
* Returns: the width of @screen in pixels.
*
* Since: 2.2
*
* Deprecated: 3.22: Use per-monitor information instead
**/
gint
gdk_screen_get_width (GdkScreen *screen)
......@@ -553,6 +571,8 @@ gdk_screen_get_width (GdkScreen *screen)
* Returns: the height of @screen in pixels.
*
* Since: 2.2
*
* Deprecated: 3.22: Use per-monitor information instead
**/
gint
gdk_screen_get_height (GdkScreen *screen)
......@@ -575,6 +595,8 @@ gdk_screen_get_height (GdkScreen *screen)
* Returns: the width of @screen in millimeters.
*
* Since: 2.2
*
* Deprecated: 3.22: Use per-monitor information instead
**/
gint
gdk_screen_get_width_mm (GdkScreen *screen)
......@@ -596,6 +618,8 @@ gdk_screen_get_width_mm (GdkScreen *screen)
*
* Returns: the heigth of @screen in millimeters.
*
* Deprecated: 3.22: Use per-monitor information instead
*
* Since: 2.2
**/
gint
......@@ -616,6 +640,8 @@ gdk_screen_get_height_mm (GdkScreen *screen)
* Returns: the index
*
* Since: 2.2
*
* Deprecated: 3.22
**/
gint
gdk_screen_get_number (GdkScreen *screen)
......@@ -990,6 +1016,8 @@ gdk_screen_is_composited (GdkScreen *screen)
* Returns: a newly allocated string, free with g_free()
*
* Since: 2.2
*
* Deprecated: 3.22
**/
gchar *
gdk_screen_make_display_name (GdkScreen *screen)
......@@ -1022,6 +1050,8 @@ gdk_screen_make_display_name (GdkScreen *screen)
* or %NULL.
*
* Since: 2.10
*
* Deprecated: 3.22
**/
GdkWindow *
gdk_screen_get_active_window (GdkScreen *screen)
......
......@@ -52,22 +52,22 @@ GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_screen_get_root_window (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_screen_get_display (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_22
gint gdk_screen_get_number (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_22
gint gdk_screen_get_width (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_22
gint gdk_screen_get_height (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_22
gint gdk_screen_get_width_mm (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_22
gint gdk_screen_get_height_mm (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GList * gdk_screen_list_visuals (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GList * gdk_screen_get_toplevel_windows (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_22
gchar * gdk_screen_make_display_name (GdkScreen *screen);
GDK_DEPRECATED_IN_3_22_FOR(gdk_display_get_n_monitors)
......@@ -123,7 +123,7 @@ void gdk_screen_set_resolution (GdkScreen *screen,
GDK_AVAILABLE_IN_ALL
gdouble gdk_screen_get_resolution (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_22
GdkWindow *gdk_screen_get_active_window (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GList *gdk_screen_get_window_stack (GdkScreen *screen);
......
......@@ -10847,10 +10847,10 @@ void
gdk_window_fullscreen_on_monitor (GdkWindow *window,
gint monitor)
{
GdkScreen *screen = gdk_window_get_screen (window);
GdkDisplay *display = gdk_window_get_display (window);
g_return_if_fail (monitor >= 0);
g_return_if_fail (monitor < gdk_screen_get_n_monitors (screen));
g_return_if_fail (monitor < gdk_display_get_n_monitors (display));
if (GDK_WINDOW_IMPL_GET_CLASS (window->impl)->fullscreen_on_monitor != NULL)
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->fullscreen_on_monitor (window, monitor);
......
......@@ -346,7 +346,7 @@ gdk_x11_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
if (timestamp == GDK_CURRENT_TIME)
timestamp = gdk_x11_display_get_user_time (display);
screen_str = g_strdup_printf ("%d", gdk_screen_get_number (screen));
screen_str = g_strdup_printf ("%d", gdk_x11_screen_get_number (screen));
if (ctx->workspace > -1)
workspace_str = g_strdup_printf ("%d", ctx->workspace);
else
......
......@@ -638,8 +638,8 @@ gdk_window_cache_new (GdkScreen *screen)
{
cow = XCompositeGetOverlayWindow (xdisplay, GDK_WINDOW_XID (root_window));
gdk_window_cache_add (result, cow, 0, 0,
gdk_screen_get_width (screen) * GDK_X11_SCREEN(screen)->window_scale,
gdk_screen_get_height (screen) * GDK_X11_SCREEN(screen)->window_scale,
gdk_x11_screen_get_width (screen) * GDK_X11_SCREEN(screen)->window_scale,
gdk_x11_screen_get_height (screen) * GDK_X11_SCREEN(screen)->window_scale,
TRUE);
XCompositeReleaseOverlayWindow (xdisplay, GDK_WINDOW_XID (root_window));
}
......
......@@ -434,7 +434,7 @@ gdk_x11_ungrab_server (void)
gint
gdk_x11_get_default_screen (void)
{
return gdk_screen_get_number (gdk_screen_get_default ());
return gdk_x11_screen_get_number (gdk_screen_get_default ());
}
/**
......
......@@ -79,13 +79,13 @@ gdk_x11_screen_get_display (GdkScreen *screen)
return GDK_X11_SCREEN (screen)->display;
}
static gint
gint
gdk_x11_screen_get_width (GdkScreen *screen)
{
return GDK_X11_SCREEN (screen)->width / GDK_X11_SCREEN (screen)->window_scale;
}
static gint
gint
gdk_x11_screen_get_height (GdkScreen *screen)
{
return GDK_X11_SCREEN (screen)->height / GDK_X11_SCREEN (screen)->window_scale;
......@@ -103,7 +103,7 @@ gdk_x11_screen_get_height_mm (GdkScreen *screen)
return HeightMMOfScreen (GDK_X11_SCREEN (screen)->xscreen);
}
static gint
gint
gdk_x11_screen_get_number (GdkScreen *screen)
{
return GDK_X11_SCREEN (screen)->screen_num;
......@@ -259,8 +259,8 @@ gdk_x11_screen_get_work_area (GdkScreen *screen,
/* Defaults in case of error */
area->x = 0;
area->y = 0;
area->width = gdk_screen_get_width (screen);
area->height = gdk_screen_get_height (screen);
area->width = gdk_x11_screen_get_width (screen);
area->height = gdk_x11_screen_get_height (screen);
if (!gdk_x11_screen_supports_net_wm_hint (screen,
gdk_atom_intern_static_string ("_NET_WORKAREA")))
......@@ -783,20 +783,20 @@ init_no_multihead (GdkScreen *screen, gboolean *changed)
gdk_monitor_get_geometry (GDK_MONITOR (monitor), &geometry);
if (0 != geometry.x ||
0 != geometry.y ||
gdk_screen_get_width (screen) != geometry.width ||
gdk_screen_get_height (screen) != geometry.height ||
gdk_screen_get_width_mm (screen) != gdk_monitor_get_width_mm (GDK_MONITOR (monitor)) ||
gdk_screen_get_height_mm (screen) != gdk_monitor_get_height_mm (GDK_MONITOR (monitor)))
gdk_x11_screen_get_width (screen) != geometry.width ||
gdk_x11_screen_get_height (screen) != geometry.height ||
gdk_x11_screen_get_width_mm (screen) != gdk_monitor_get_width_mm (GDK_MONITOR (monitor)) ||
gdk_x11_screen_get_height_mm (screen) != gdk_monitor_get_height_mm (GDK_MONITOR (monitor)))
*changed = TRUE;
gdk_monitor_set_position (GDK_MONITOR (monitor), 0, 0);
gdk_monitor_set_size (GDK_MONITOR (monitor),
gdk_screen_get_width (screen),
gdk_screen_get_height (screen));
gdk_x11_screen_get_width (screen),
gdk_x11_screen_get_height (screen));
g_object_notify (G_OBJECT (monitor), "workarea");
gdk_monitor_set_physical_size (GDK_MONITOR (monitor),
gdk_screen_get_width_mm (screen),
gdk_screen_get_height_mm (screen));
gdk_x11_screen_get_width_mm (screen),
gdk_x11_screen_get_height_mm (screen));
gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), x11_screen->window_scale);
if (x11_display->primary_monitor != 0)
......@@ -1002,8 +1002,8 @@ _gdk_x11_screen_size_changed (GdkScreen *screen,
GdkX11Display *display_x11;
#endif
width = gdk_screen_get_width (screen);
height = gdk_screen_get_height (screen);
width = gdk_x11_screen_get_width (screen);
height = gdk_x11_screen_get_height (screen);
#ifdef HAVE_RANDR
display_x11 = GDK_X11_DISPLAY (gdk_screen_get_display (screen));
......@@ -1027,8 +1027,8 @@ _gdk_x11_screen_size_changed (GdkScreen *screen,
process_monitors_change (screen);
if (width != gdk_screen_get_width (screen) ||
height != gdk_screen_get_height (screen))
if (width != gdk_x11_screen_get_width (screen) ||
height != gdk_x11_screen_get_height (screen))
g_signal_emit_by_name (screen, "size-changed");
}
......@@ -1147,7 +1147,7 @@ gdk_x11_screen_make_display_name (GdkScreen *screen)
old_display = gdk_display_get_name (gdk_screen_get_display (screen));
return substitute_screen_number (old_display,
gdk_screen_get_number (screen));
gdk_x11_screen_get_number (screen));
}
static GdkWindow *
......
......@@ -121,6 +121,9 @@ void _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen,
int scale);
void gdk_x11_screen_get_work_area (GdkScreen *screen,
GdkRectangle *area);
gint gdk_x11_screen_get_width (GdkScreen *screen);
gint gdk_x11_screen_get_height (GdkScreen *screen);
gint gdk_x11_screen_get_number (GdkScreen *screen);
G_END_DECLS
......
......@@ -2103,7 +2103,7 @@ gdk_window_x11_restack_toplevel (GdkWindow *window,
changes.stack_mode = above ? Above : Below;
XReconfigureWMWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
gdk_screen_get_number (GDK_WINDOW_SCREEN (window)),
gdk_x11_screen_get_number (GDK_WINDOW_SCREEN (window)),
CWStackMode | CWSibling, &changes);
}
......@@ -4003,7 +4003,7 @@ gdk_x11_window_iconify (GdkWindow *window)
{
XIconifyWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
gdk_screen_get_number (GDK_WINDOW_SCREEN (window)));
gdk_x11_screen_get_number (GDK_WINDOW_SCREEN (window)));
}
else
{
......
......@@ -396,7 +396,9 @@ populate_display (GdkScreen *screen, GtkInspectorGeneral *gen)
}
g_list_free (children);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
name = gdk_screen_make_display_name (screen);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_label_set_label (GTK_LABEL (gen->priv->display_name), name);
g_free (name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment