Skip to content
Commits on Source (24)
Version 3.46.0
==============
- Fix build with with gnome-desktop 43. (#83)
- Port system indicators to gnome-bluetooth 42. (#80)
- Updated translations.
Version 3.45.1
==============
- Adapt to gnome-desktop API changes.
......
......@@ -262,6 +262,33 @@ get_monitor_transform (GfMonitorManager *monitor_manager,
return gf_monitor_transform_from_orientation (orientation);
}
static void
scale_logical_monitor_width (GfLogicalMonitorLayoutMode layout_mode,
float scale,
int mode_width,
int mode_height,
int *width,
int *height)
{
switch (layout_mode)
{
case GF_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL:
*width = (int) roundf (mode_width / scale);
*height = (int) roundf (mode_height / scale);
return;
case GF_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL:
*width = mode_width;
*height = mode_height;
return;
default:
break;
}
g_assert_not_reached ();
}
static GfLogicalMonitorConfig *
create_preferred_logical_monitor_config (GfMonitorManager *monitor_manager,
GfMonitor *monitor,
......@@ -279,17 +306,12 @@ create_preferred_logical_monitor_config (GfMonitorManager *monitor_man
mode = gf_monitor_get_preferred_mode (monitor);
gf_monitor_mode_get_resolution (mode, &width, &height);
switch (layout_mode)
{
case GF_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL:
width = (int) roundf (width / scale);
height = (int) roundf (height / scale);
break;
case GF_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL:
default:
break;
}
scale_logical_monitor_width (layout_mode,
scale,
width,
height,
&width,
&height);
monitor_config = gf_monitor_config_new (monitor, mode);
transform = get_monitor_transform (monitor_manager, monitor);
......@@ -318,10 +340,125 @@ create_preferred_logical_monitor_config (GfMonitorManager *monitor_man
return logical_monitor_config;
}
static GfLogicalMonitorConfig *
find_monitor_config (GfMonitorsConfig *config,
GfMonitor *monitor,
GfMonitorMode *monitor_mode)
{
int mode_width;
int mode_height;
GList *l;
gf_monitor_mode_get_resolution (monitor_mode, &mode_width, &mode_height);
for (l = config->logical_monitor_configs; l; l = l->next)
{
GfLogicalMonitorConfig *logical_monitor_config;
GList *l_monitor;
logical_monitor_config = l->data;
for (l_monitor = logical_monitor_config->monitor_configs; l_monitor; l_monitor = l_monitor->next)
{
GfMonitorConfig *monitor_config;
GfMonitorModeSpec *mode_spec;
monitor_config = l_monitor->data;
mode_spec = gf_monitor_mode_get_spec (monitor_mode);
if (gf_monitor_spec_equals (gf_monitor_get_spec (monitor), monitor_config->monitor_spec) &&
gf_monitor_mode_spec_has_similar_size (mode_spec, monitor_config->mode_spec))
return logical_monitor_config;
}
}
return NULL;
}
static gboolean
get_last_scale_for_monitor (GfMonitorConfigManager *config_manager,
GfMonitor *monitor,
GfMonitorMode *monitor_mode,
float *out_scale)
{
GList *configs;
GList *l;
configs = NULL;
if (config_manager->current_config != NULL)
configs = g_list_append (configs, config_manager->current_config);
configs = g_list_concat (configs, g_list_copy (config_manager->config_history.head));
for (l = configs; l; l = l->next)
{
GfMonitorsConfig *config;
GfLogicalMonitorConfig *logical_monitor_config;
config = l->data;
logical_monitor_config = find_monitor_config (config,
monitor,
monitor_mode);
if (logical_monitor_config != NULL)
{
*out_scale = logical_monitor_config->scale;
g_list_free (configs);
return TRUE;
}
}
g_list_free (configs);
return FALSE;
}
static float
compute_scale_for_monitor (GfMonitorConfigManager *config_manager,
GfMonitor *monitor,
GfMonitor *primary_monitor)
{
GfMonitorManager *monitor_manager;
GfMonitor *target_monitor;
GfMonitorManagerCapability capabilities;
GfLogicalMonitorLayoutMode layout_mode;
GfMonitorMode *monitor_mode;
float scale;
monitor_manager = config_manager->monitor_manager;
target_monitor = monitor;
capabilities = gf_monitor_manager_get_capabilities (monitor_manager);
if ((capabilities & GF_MONITOR_MANAGER_CAPABILITY_GLOBAL_SCALE_REQUIRED) &&
primary_monitor != NULL)
{
target_monitor = primary_monitor;
}
layout_mode = gf_monitor_manager_get_default_layout_mode (monitor_manager);
monitor_mode = gf_monitor_get_preferred_mode (target_monitor);
if (get_last_scale_for_monitor (config_manager,
target_monitor,
monitor_mode,
&scale))
return scale;
return gf_monitor_manager_calculate_monitor_mode_scale (monitor_manager,
layout_mode,
target_monitor,
monitor_mode);
}
static GfMonitorsConfig *
create_for_switch_config_all_mirror (GfMonitorConfigManager *config_manager)
{
GfMonitorManager *monitor_manager = config_manager->monitor_manager;
GfMonitor *primary_monitor;
GfLogicalMonitorLayoutMode layout_mode;
GfLogicalMonitorConfig *logical_monitor_config = NULL;
GList *logical_monitor_configs;
......@@ -333,6 +470,14 @@ create_for_switch_config_all_mirror (GfMonitorConfigManager *config_manager)
GList *monitors;
GList *l;
GfMonitorsConfig *monitors_config;
int width;
int height;
primary_monitor = find_primary_monitor (monitor_manager,
MONITOR_MATCH_ALLOW_FALLBACK);
if (primary_monitor == NULL)
return NULL;
layout_mode = gf_monitor_manager_get_default_layout_mode (monitor_manager);
monitors = gf_monitor_manager_get_monitors (monitor_manager);
......@@ -406,25 +551,32 @@ create_for_switch_config_all_mirror (GfMonitorConfigManager *config_manager)
if (!mode)
continue;
scale = gf_monitor_manager_calculate_monitor_mode_scale (monitor_manager,
layout_mode,
l_monitor,
mode);
scale = compute_scale_for_monitor (config_manager,
l_monitor,
primary_monitor);
best_scale = MAX (best_scale, scale);
monitor_configs = g_list_prepend (monitor_configs, gf_monitor_config_new (l_monitor, mode));
}
scale_logical_monitor_width (layout_mode,
best_scale,
common_mode_w,
common_mode_h,
&width,
&height);
logical_monitor_config = g_new0 (GfLogicalMonitorConfig, 1);
*logical_monitor_config = (GfLogicalMonitorConfig) {
.layout = (GfRectangle) {
.x = 0,
.y = 0,
.width = common_mode_w,
.height = common_mode_h
.width = width,
.height = height
},
.scale = best_scale,
.monitor_configs = monitor_configs
.monitor_configs = monitor_configs,
.is_primary = TRUE
};
logical_monitor_configs = g_list_append (NULL, logical_monitor_config);
......@@ -487,35 +639,6 @@ verify_suggested_monitors_config (GList *logical_monitor_configs)
return TRUE;
}
static float
compute_scale_for_monitor (GfMonitorManager *monitor_manager,
GfMonitor *monitor,
GfMonitor *primary_monitor)
{
GfMonitor *target_monitor;
GfMonitorManagerCapability capabilities;
GfLogicalMonitorLayoutMode layout_mode;
GfMonitorMode *monitor_mode;
target_monitor = monitor;
capabilities = gf_monitor_manager_get_capabilities (monitor_manager);
if ((capabilities & GF_MONITOR_MANAGER_CAPABILITY_GLOBAL_SCALE_REQUIRED) &&
primary_monitor != NULL)
{
target_monitor = primary_monitor;
}
layout_mode = gf_monitor_manager_get_default_layout_mode (monitor_manager);
monitor_mode = gf_monitor_get_preferred_mode (target_monitor);
return gf_monitor_manager_calculate_monitor_mode_scale (monitor_manager,
layout_mode,
target_monitor,
monitor_mode);
}
static GfMonitorsConfig *
create_monitors_config (GfMonitorConfigManager *config_manager,
MonitorMatchRule match_rule,
......@@ -571,7 +694,7 @@ create_monitors_config (GfMonitorConfigManager *config_manager,
break;
}
scale = compute_scale_for_monitor (monitor_manager,
scale = compute_scale_for_monitor (config_manager,
monitor,
primary_monitor);
......@@ -668,7 +791,9 @@ clone_monitor_config_list (GList *configs_in)
*config_out = (GfMonitorConfig) {
.monitor_spec = gf_monitor_spec_clone (config_in->monitor_spec),
.mode_spec = g_memdup2 (config_in->mode_spec, sizeof (GfMonitorModeSpec)),
.enable_underscanning = config_in->enable_underscanning
.enable_underscanning = config_in->enable_underscanning,
.has_max_bpc = config_in->has_max_bpc,
.max_bpc = config_in->max_bpc
};
configs_out = g_list_append (configs_out, config_out);
......@@ -1022,7 +1147,9 @@ assign_monitor_crtc (GfMonitor *monitor,
.output = output,
.is_primary = assign_output_as_primary,
.is_presentation = assign_output_as_presentation,
.is_underscanning = data->monitor_config->enable_underscanning
.is_underscanning = data->monitor_config->enable_underscanning,
.has_max_bpc = data->monitor_config->has_max_bpc,
.max_bpc = data->monitor_config->max_bpc
};
g_ptr_array_add (data->crtc_assignments, crtc_assignment);
......@@ -1061,7 +1188,7 @@ assign_monitor_crtcs (GfMonitorManager *manager,
if (!monitor_mode)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Invalid mode %dx%d (%f) for monitor '%s %s'",
"Invalid mode %dx%d (%.3f) for monitor '%s %s'",
monitor_mode_spec->width, monitor_mode_spec->height,
(gdouble) monitor_mode_spec->refresh_rate,
monitor_spec->vendor, monitor_spec->product);
......
......@@ -31,6 +31,8 @@ typedef struct
GfMonitorSpec *monitor_spec;
GfMonitorModeSpec *mode_spec;
gboolean enable_underscanning;
gboolean has_max_bpc;
unsigned int max_bpc;
} GfMonitorConfig;
GfMonitorConfig *gf_monitor_config_new (GfMonitor *monitor,
......
......@@ -158,6 +158,7 @@ typedef enum
STATE_MONITOR_MODE_RATE,
STATE_MONITOR_MODE_FLAG,
STATE_MONITOR_UNDERSCANNING,
STATE_MONITOR_MAXBPC,
STATE_DISABLED,
STATE_POLICY,
STATE_STORES,
......@@ -497,6 +498,10 @@ handle_start_element (GMarkupParseContext *context,
{
parser->state = STATE_MONITOR_UNDERSCANNING;
}
else if (g_str_equal (element_name, "maxbpc"))
{
parser->state = STATE_MONITOR_MAXBPC;
}
else
{
g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
......@@ -590,6 +595,13 @@ handle_start_element (GMarkupParseContext *context,
return;
}
case STATE_MONITOR_MAXBPC:
{
g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
"Invalid element '%s' under maxbpc", element_name);
return;
}
case STATE_DISABLED:
{
if (!g_str_equal (element_name, "monitorspec"))
......@@ -791,6 +803,7 @@ finish_monitor_spec (ConfigParser *parser)
case STATE_MONITOR_MODE_RATE:
case STATE_MONITOR_MODE_FLAG:
case STATE_MONITOR_UNDERSCANNING:
case STATE_MONITOR_MAXBPC:
case STATE_POLICY:
case STATE_STORES:
case STATE_STORE:
......@@ -899,6 +912,14 @@ handle_end_element (GMarkupParseContext *context,
return;
}
case STATE_MONITOR_MAXBPC:
{
g_assert (g_str_equal (element_name, "maxbpc"));
parser->state = STATE_MONITOR;
return;
}
case STATE_MONITOR:
{
GfLogicalMonitorConfig *logical_monitor_config;
......@@ -1378,6 +1399,29 @@ handle_text (GMarkupParseContext *context,
return;
}
case STATE_MONITOR_MAXBPC:
{
int signed_max_bpc;
if (read_int (text, text_len, &signed_max_bpc, error))
{
if (signed_max_bpc >= 0)
{
parser->current_monitor_config->has_max_bpc = TRUE;
parser->current_monitor_config->max_bpc = signed_max_bpc;
}
else
{
g_set_error (error, G_MARKUP_ERROR,
G_MARKUP_ERROR_INVALID_CONTENT,
"Invalid negative maxbpc value '%s'",
text);
}
}
return;
}
case STATE_STORE:
{
GfConfigStore store;
......@@ -1602,12 +1646,15 @@ append_monitors (GString *buffer,
{
GfMonitorConfig *monitor_config;
GfMonitorModeSpec *mode_spec;
gchar rate_str[G_ASCII_DTOSTR_BUF_SIZE];
char rate_str[G_ASCII_DTOSTR_BUF_SIZE];
monitor_config = l->data;
mode_spec = monitor_config->mode_spec;
g_ascii_dtostr (rate_str, sizeof (rate_str), mode_spec->refresh_rate);
g_ascii_formatd (rate_str,
sizeof (rate_str),
"%.3f",
mode_spec->refresh_rate);
g_string_append (buffer, " <monitor>\n");
append_monitor_spec (buffer, monitor_config->monitor_spec, " ");
......@@ -1620,6 +1667,13 @@ append_monitors (GString *buffer,
g_string_append (buffer, " </mode>\n");
if (monitor_config->enable_underscanning)
g_string_append (buffer, " <underscanning>yes</underscanning>\n");
if (monitor_config->has_max_bpc)
{
g_string_append_printf (buffer, " <maxbpc>%u</maxbpc>\n",
monitor_config->max_bpc);
}
g_string_append (buffer, " </monitor>\n");
}
}
......
......@@ -42,6 +42,8 @@ gf_monitor_config_new (GfMonitor *monitor,
config->mode_spec = g_memdup2 (mode_spec, sizeof (GfMonitorModeSpec));
config->enable_underscanning = gf_monitor_is_underscanning (monitor);
config->has_max_bpc = gf_monitor_get_max_bpc (monitor, &config->max_bpc);
return config;
}
......
......@@ -70,7 +70,11 @@ typedef enum
GF_CONNECTOR_TYPE_TV = 13,
GF_CONNECTOR_TYPE_eDP = 14,
GF_CONNECTOR_TYPE_VIRTUAL = 15,
GF_CONNECTOR_TYPE_DSI = 16
GF_CONNECTOR_TYPE_DSI = 16,
GF_CONNECTOR_TYPE_DPI = 17,
GF_CONNECTOR_TYPE_WRITEBACK = 18,
GF_CONNECTOR_TYPE_SPI = 19,
GF_CONNECTOR_TYPE_USB = 20
} GfConnectorType;
G_END_DECLS
......
......@@ -141,6 +141,7 @@ is_output_assignment_changed (GfOutput *output,
for (i = 0; i < n_output_assignments; i++)
{
GfOutputAssignment *output_assignment;
unsigned int max_bpc;
output_assignment = output_assignments[i];
......@@ -156,6 +157,17 @@ is_output_assignment_changed (GfOutput *output,
if (gf_output_is_underscanning (output) != output_assignment->is_underscanning)
return TRUE;
if (gf_output_get_max_bpc (output, &max_bpc))
{
if (!output_assignment->has_max_bpc ||
max_bpc != output_assignment->max_bpc)
return TRUE;
}
else if (output_assignment->has_max_bpc)
{
return TRUE;
}
output_is_found = TRUE;
}
......
......@@ -1195,6 +1195,10 @@ get_connector_type_name (GfConnectorType connector_type)
case GF_CONNECTOR_TYPE_eDP: return "eDP";
case GF_CONNECTOR_TYPE_VIRTUAL: return "VIRTUAL";
case GF_CONNECTOR_TYPE_DSI: return "DSI";
case GF_CONNECTOR_TYPE_DPI: return "DPI";
case GF_CONNECTOR_TYPE_WRITEBACK: return "WRITEBACK";
case GF_CONNECTOR_TYPE_SPI: return "SPI";
case GF_CONNECTOR_TYPE_USB: return "USB";
default: g_assert_not_reached ();
}
......
......@@ -139,6 +139,9 @@ gboolean gf_monitor_supports_underscanning (GfMonitor
gboolean gf_monitor_is_underscanning (GfMonitor *monitor);
gboolean gf_monitor_get_max_bpc (GfMonitor *self,
unsigned int *max_bpc);
gboolean gf_monitor_is_laptop_panel (GfMonitor *monitor);
gboolean gf_monitor_is_same_as (GfMonitor *monitor,
......@@ -182,6 +185,9 @@ GfLogicalMonitor *gf_monitor_get_logical_monitor (GfMonitor
GfMonitorMode *gf_monitor_get_mode_from_id (GfMonitor *monitor,
const gchar *monitor_mode_id);
gboolean gf_monitor_mode_spec_has_similar_size (GfMonitorModeSpec *monitor_mode_spec,
GfMonitorModeSpec *other_monitor_mode_spec);
GfMonitorMode *gf_monitor_get_mode_from_spec (GfMonitor *monitor,
GfMonitorModeSpec *monitor_mode_spec);
......
......@@ -269,6 +269,10 @@ calculate_scale (GfMonitor *monitor,
case GF_CONNECTOR_TYPE_eDP:
case GF_CONNECTOR_TYPE_VIRTUAL:
case GF_CONNECTOR_TYPE_DSI:
case GF_CONNECTOR_TYPE_DPI:
case GF_CONNECTOR_TYPE_WRITEBACK:
case GF_CONNECTOR_TYPE_SPI:
case GF_CONNECTOR_TYPE_USB:
default:
break;
}
......@@ -711,13 +715,14 @@ gchar *
gf_monitor_mode_spec_generate_id (GfMonitorModeSpec *spec)
{
gboolean is_interlaced;
gchar refresh_rate[G_ASCII_DTOSTR_BUF_SIZE];
is_interlaced = !!(spec->flags & GF_CRTC_MODE_FLAG_INTERLACE);
g_ascii_dtostr (refresh_rate, G_ASCII_DTOSTR_BUF_SIZE, spec->refresh_rate);
return g_strdup_printf ("%dx%d%s@%s", spec->width, spec->height,
is_interlaced ? "i" : "", refresh_rate);
return g_strdup_printf ("%dx%d%s@%.3f",
spec->width,
spec->height,
is_interlaced ? "i" : "",
(double) spec->refresh_rate);
}
GfMonitorSpec *
......@@ -776,6 +781,17 @@ gf_monitor_is_underscanning (GfMonitor *monitor)
return gf_output_is_underscanning (output);
}
gboolean
gf_monitor_get_max_bpc (GfMonitor *self,
unsigned int *max_bpc)
{
GfOutput *output;
output = gf_monitor_get_main_output (self);
return gf_output_get_max_bpc (output, max_bpc);
}
gboolean
gf_monitor_is_laptop_panel (GfMonitor *monitor)
{
......@@ -804,6 +820,10 @@ gf_monitor_is_laptop_panel (GfMonitor *monitor)
case GF_CONNECTOR_TYPE_DisplayPort:
case GF_CONNECTOR_TYPE_TV:
case GF_CONNECTOR_TYPE_VIRTUAL:
case GF_CONNECTOR_TYPE_DPI:
case GF_CONNECTOR_TYPE_WRITEBACK:
case GF_CONNECTOR_TYPE_SPI:
case GF_CONNECTOR_TYPE_USB:
default:
break;
}
......@@ -966,6 +986,25 @@ gf_monitor_get_mode_from_id (GfMonitor *monitor,
return g_hash_table_lookup (priv->mode_ids, monitor_mode_id);
}
gboolean
gf_monitor_mode_spec_has_similar_size (GfMonitorModeSpec *monitor_mode_spec,
GfMonitorModeSpec *other_monitor_mode_spec)
{
const float target_ratio = 1.0;
/* The a size difference of 15% means e.g. 4K modes matches other 4K modes,
* FHD (2K) modes other FHD modes, and HD modes other HD modes, but not each
* other.
*/
const float epsilon = 0.15;
return G_APPROX_VALUE (((float) monitor_mode_spec->width /
other_monitor_mode_spec->width) *
((float) monitor_mode_spec->height /
other_monitor_mode_spec->height),
target_ratio,
epsilon);
}
GfMonitorMode *
gf_monitor_get_mode_from_spec (GfMonitor *monitor,
GfMonitorModeSpec *monitor_mode_spec)
......
......@@ -74,6 +74,9 @@ typedef struct
gboolean supports_underscanning;
gboolean supports_color_transform;
unsigned int max_bpc_min;
unsigned int max_bpc_max;
/* Get a new preferred mode on hotplug events, to handle
* dynamic guest resizing
*/
......
......@@ -45,6 +45,8 @@ typedef struct
gboolean is_primary;
gboolean is_presentation;
gboolean is_underscanning;
gboolean has_max_bpc;
unsigned int max_bpc;
} GfOutputAssignment;
#define GF_TYPE_OUTPUT (gf_output_get_type ())
......@@ -92,6 +94,9 @@ gboolean gf_output_is_presentation (GfOutput
gboolean gf_output_is_underscanning (GfOutput *self);
gboolean gf_output_get_max_bpc (GfOutput *self,
unsigned int *max_bpc);
void gf_output_set_backlight (GfOutput *self,
int backlight);
......
......@@ -154,6 +154,25 @@ output_set_underscanning_xrandr (GfOutput *output,
}
}
static void
output_set_max_bpc_xrandr (GfOutput *output,
unsigned int max_bpc)
{
Display *xdisplay;
Atom prop;
uint32_t value;
xdisplay = xdisplay_from_output (output);
prop = XInternAtom (xdisplay, "max bpc", False);
value = max_bpc;
xcb_randr_change_output_property (XGetXCBConnection (xdisplay),
(XID) gf_output_get_id (output),
prop, XCB_ATOM_INTEGER, 32,
XCB_PROP_MODE_REPLACE,
1, &value);
}
static guint8 *
get_edid_property (Display *xdisplay,
RROutput output,
......@@ -637,6 +656,52 @@ output_get_boolean_property (GfOutput *output,
return value;
}
static gboolean
output_get_max_bpc_xrandr (GfOutput *output,
unsigned int *max_bpc)
{
Display *xdisplay;
Atom atom;
Atom actual_type;
int actual_format;
unsigned long nitems;
unsigned long bytes_after;
unsigned char *buffer;
xdisplay = xdisplay_from_output (output);
atom = XInternAtom (xdisplay, "max bpc", False);
buffer = NULL;
XRRGetOutputProperty (xdisplay,
(XID) gf_output_get_id (output),
atom,
0,
G_MAXLONG,
False,
False,
XCB_ATOM_INTEGER,
&actual_type,
&actual_format,
&nitems,
&bytes_after,
&buffer);
if (actual_type != XCB_ATOM_INTEGER || actual_format != 32 || nitems < 1)
{
if (buffer != NULL)
XFree (buffer);
return FALSE;
}
if (max_bpc)
*max_bpc = *((uint32_t*) buffer);
XFree (buffer);
return TRUE;
}
static gboolean
output_get_presentation_xrandr (GfOutput *output)
{
......@@ -685,12 +750,14 @@ output_get_supports_underscanning_xrandr (Display *xdisplay,
Atom atom, actual_type;
gint actual_format, i;
gulong nitems, bytes_after;
guchar *buffer;
unsigned char *buffer;
XRRPropertyInfo *property_info;
Atom *values;
gboolean supports_underscanning = FALSE;
atom = XInternAtom (xdisplay, "underscan", False);
buffer = NULL;
XRRGetOutputProperty (xdisplay, (XID) output_id, atom,
0, G_MAXLONG, False, False, XA_ATOM,
&actual_type, &actual_format,
......@@ -704,6 +771,8 @@ output_get_supports_underscanning_xrandr (Display *xdisplay,
return FALSE;
}
XFree (buffer);
property_info = XRRQueryOutputProperty (xdisplay, (XID) output_id, atom);
values = (Atom *) property_info->values;
......@@ -724,6 +793,44 @@ output_get_supports_underscanning_xrandr (Display *xdisplay,
return supports_underscanning;
}
static gboolean
output_get_max_bpc_range_xrandr (Display *xdisplay,
RROutput output_id,
unsigned int *min,
unsigned int *max)
{
Atom atom;
XRRPropertyInfo *property_info;
long *values;
if (!output_get_property_exists (xdisplay, output_id, "max bpc"))
return FALSE;
atom = XInternAtom (xdisplay, "max bpc", False);
property_info = XRRQueryOutputProperty (xdisplay, (XID) output_id, atom);
if (property_info == NULL)
return FALSE;
if (property_info->num_values != 2)
{
XFree (property_info);
return FALSE;
}
values = (long *) property_info->values;
if (min)
*min = values[0];
if (max)
*max = values[1];
XFree (property_info);
return TRUE;
}
static gboolean
output_get_supports_color_transform_xrandr (Display *xdisplay,
RROutput output_id)
......@@ -920,6 +1027,12 @@ gf_output_xrandr_new (GfGpuXrandr *gpu_xrandr,
output_info->supports_underscanning = output_get_supports_underscanning_xrandr (xdisplay,
output_id);
output_get_max_bpc_range_xrandr (xdisplay,
output_id,
&output_info->max_bpc_min,
&output_info->max_bpc_max);
output_info->supports_color_transform = output_get_supports_color_transform_xrandr (xdisplay,
output_id);
......@@ -935,6 +1048,7 @@ gf_output_xrandr_new (GfGpuXrandr *gpu_xrandr,
if (assigned_crtc)
{
GfOutputAssignment output_assignment;
gboolean has_max_bpc;
output_assignment = (GfOutputAssignment) {
.is_primary = (XID) gf_output_get_id (output) == primary_output,
......@@ -942,6 +1056,9 @@ gf_output_xrandr_new (GfGpuXrandr *gpu_xrandr,
.is_underscanning = output_get_underscanning_xrandr (output),
};
has_max_bpc = output_get_max_bpc_xrandr (output, &output_assignment.max_bpc);
output_assignment.has_max_bpc = has_max_bpc;
gf_output_assign_crtc (output, assigned_crtc, &output_assignment);
}
else
......@@ -983,9 +1100,12 @@ gf_output_xrandr_apply_mode (GfOutputXrandr *self)
{
GfOutput *output;
Display *xdisplay;
const GfOutputInfo *output_info;
unsigned int max_bpc;
output = GF_OUTPUT (self);
xdisplay = xdisplay_from_output (output);
output_info = gf_output_get_info (output);
if (gf_output_is_primary (output))
{
......@@ -995,11 +1115,18 @@ gf_output_xrandr_apply_mode (GfOutputXrandr *self)
output_set_presentation_xrandr (output, gf_output_is_presentation (output));
if (gf_output_get_info (output)->supports_underscanning)
if (output_info->supports_underscanning)
{
output_set_underscanning_xrandr (output,
gf_output_is_underscanning (output));
}
if (gf_output_get_max_bpc (output, &max_bpc) &&
max_bpc >= output_info->max_bpc_min &&
max_bpc <= output_info->max_bpc_max)
{
output_set_max_bpc_xrandr (output, max_bpc);
}
}
void
......
......@@ -49,6 +49,9 @@ typedef struct
gboolean is_underscanning;
gboolean has_max_bpc;
unsigned int max_bpc;
int backlight;
} GfOutputPrivate;
......@@ -311,6 +314,11 @@ gf_output_assign_crtc (GfOutput *self,
priv->is_primary = output_assignment->is_primary;
priv->is_presentation = output_assignment->is_presentation;
priv->is_underscanning = output_assignment->is_underscanning;
priv->has_max_bpc = output_assignment->has_max_bpc;
if (priv->has_max_bpc)
priv->max_bpc = output_assignment->max_bpc;
}
void
......@@ -368,6 +376,10 @@ gf_output_is_laptop (GfOutput *output)
case GF_CONNECTOR_TYPE_HDMIB:
case GF_CONNECTOR_TYPE_TV:
case GF_CONNECTOR_TYPE_VIRTUAL:
case GF_CONNECTOR_TYPE_DPI:
case GF_CONNECTOR_TYPE_WRITEBACK:
case GF_CONNECTOR_TYPE_SPI:
case GF_CONNECTOR_TYPE_USB:
default:
break;
}
......@@ -435,6 +447,20 @@ gf_output_is_underscanning (GfOutput *self)
return priv->is_underscanning;
}
gboolean
gf_output_get_max_bpc (GfOutput *self,
unsigned int *max_bpc)
{
GfOutputPrivate *priv;
priv = gf_output_get_instance_private (self);
if (priv->has_max_bpc && max_bpc != NULL)
*max_bpc = priv->max_bpc;
return priv->has_max_bpc;
}
void
gf_output_set_backlight (GfOutput *self,
int backlight)
......
......@@ -10,9 +10,6 @@
/* Define to 1 if alsa is available */
#undef HAVE_ALSA
/* xxx */
#undef HAVE_BLUETOOTH_TYPE_SPEAKERS
/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
CoreFoundation framework. */
#undef HAVE_CFLOCALECOPYCURRENT
......@@ -34,12 +31,6 @@
/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT
/* Define if gnome-desktop is 43.alpha or newer */
#undef HAVE_GNOME_BLUETOOTH
/* Define if gnome-desktop is 43.alpha or newer */
#undef HAVE_GNOME_DESKTOP_43_ALPHA
/* Define if you have the iconv() function and it works. */
#undef HAVE_ICONV
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for gnome-flashback 3.45.1.
# Generated by GNU Autoconf 2.71 for gnome-flashback 3.46.0.
#
# Report bugs to <https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-flashback>.
#
......@@ -621,8 +621,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gnome-flashback'
PACKAGE_TARNAME='gnome-flashback'
PACKAGE_VERSION='3.45.1'
PACKAGE_STRING='gnome-flashback 3.45.1'
PACKAGE_VERSION='3.46.0'
PACKAGE_STRING='gnome-flashback 3.46.0'
PACKAGE_BUGREPORT='https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-flashback'
PACKAGE_URL=''
 
......@@ -668,8 +668,6 @@ WITH_COMPIZ_SESSION_FALSE
WITH_COMPIZ_SESSION_TRUE
COMPIZCONFIG_UPGRADES_DIR
COMPIZCONFIG_CONFIG_DIR
HAVE_GNOME_BLUETOOTH_FALSE
HAVE_GNOME_BLUETOOTH_TRUE
GNOME_BLUETOOTH_LIBS
GNOME_BLUETOOTH_CFLAGS
SYSTEM_INDICATORS_LIBS
......@@ -1522,7 +1520,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures gnome-flashback 3.45.1 to adapt to many kinds of systems.
\`configure' configures gnome-flashback 3.46.0 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1593,7 +1591,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of gnome-flashback 3.45.1:";;
short | recursive ) echo "Configuration of gnome-flashback 3.46.0:";;
esac
cat <<\_ACEOF
 
......@@ -1828,7 +1826,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
gnome-flashback configure 3.45.1
gnome-flashback configure 3.46.0
generated by GNU Autoconf 2.71
 
Copyright (C) 2021 Free Software Foundation, Inc.
......@@ -2127,7 +2125,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by gnome-flashback $as_me 3.45.1, which was
It was created by gnome-flashback $as_me 3.46.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
 
$ $0$ac_configure_args_raw
......@@ -6440,7 +6438,7 @@ fi
 
# Define the identity of the package.
PACKAGE='gnome-flashback'
VERSION='3.45.1'
VERSION='3.46.0'
 
 
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
......@@ -18645,7 +18643,7 @@ endif
 
GDK_PIXBUF_REQUIRED=2.32.2
GTK_REQUIRED=3.22.0
LIBGNOME_DESKTOP_REQUIRED=3.12.0
LIBGNOME_DESKTOP_REQUIRED=43
LIBGNOME_PANEL_REQUIRED=3.35.2
CANBERRA_REQUIRED=0.13
GLIB_REQUIRED=2.67.3
......@@ -22178,19 +22176,6 @@ printf "%s\n" "#define HAVE_PANGO144 1" >>confdefs.h
fi
 
 
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnome-desktop-3.0 >= 43.alpha\""; } >&5
($PKG_CONFIG --exists --print-errors "gnome-desktop-3.0 >= 43.alpha") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
printf "%s\n" "#define HAVE_GNOME_DESKTOP_43_ALPHA 1" >>confdefs.h
fi
# Check whether --enable-systemd-session was given.
if test ${enable_systemd_session+y}
then :
......@@ -22378,29 +22363,21 @@ printf "%s\n" "yes" >&6; }
 
fi
 
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnome-bluetooth-1.0\""; } >&5
($PKG_CONFIG --exists --print-errors "gnome-bluetooth-1.0") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
found_gnome_bluetooth="yes"
 
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gnome-bluetooth-1.0" >&5
printf %s "checking for gnome-bluetooth-1.0... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gnome-bluetooth-3.0" >&5
printf %s "checking for gnome-bluetooth-3.0... " >&6; }
 
if test -n "$GNOME_BLUETOOTH_CFLAGS"; then
pkg_cv_GNOME_BLUETOOTH_CFLAGS="$GNOME_BLUETOOTH_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnome-bluetooth-1.0\""; } >&5
($PKG_CONFIG --exists --print-errors "gnome-bluetooth-1.0") 2>&5
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnome-bluetooth-3.0\""; } >&5
($PKG_CONFIG --exists --print-errors "gnome-bluetooth-3.0") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GNOME_BLUETOOTH_CFLAGS=`$PKG_CONFIG --cflags "gnome-bluetooth-1.0" 2>/dev/null`
pkg_cv_GNOME_BLUETOOTH_CFLAGS=`$PKG_CONFIG --cflags "gnome-bluetooth-3.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
......@@ -22412,12 +22389,12 @@ if test -n "$GNOME_BLUETOOTH_LIBS"; then
pkg_cv_GNOME_BLUETOOTH_LIBS="$GNOME_BLUETOOTH_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnome-bluetooth-1.0\""; } >&5
($PKG_CONFIG --exists --print-errors "gnome-bluetooth-1.0") 2>&5
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnome-bluetooth-3.0\""; } >&5
($PKG_CONFIG --exists --print-errors "gnome-bluetooth-3.0") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GNOME_BLUETOOTH_LIBS=`$PKG_CONFIG --libs "gnome-bluetooth-1.0" 2>/dev/null`
pkg_cv_GNOME_BLUETOOTH_LIBS=`$PKG_CONFIG --libs "gnome-bluetooth-3.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
......@@ -22438,14 +22415,14 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
GNOME_BLUETOOTH_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnome-bluetooth-1.0" 2>&1`
GNOME_BLUETOOTH_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnome-bluetooth-3.0" 2>&1`
else
GNOME_BLUETOOTH_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnome-bluetooth-1.0" 2>&1`
GNOME_BLUETOOTH_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnome-bluetooth-3.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$GNOME_BLUETOOTH_PKG_ERRORS" >&5
 
as_fn_error $? "Package requirements (gnome-bluetooth-1.0) were not met:
as_fn_error $? "Package requirements (gnome-bluetooth-3.0) were not met:
 
$GNOME_BLUETOOTH_PKG_ERRORS
 
......@@ -22478,63 +22455,6 @@ printf "%s\n" "yes" >&6; }
 
fi
 
printf "%s\n" "#define HAVE_GNOME_BLUETOOTH 1" >>confdefs.h
else
found_gnome_bluetooth="no"
fi
if test "x$found_gnome_bluetooth" = "xyes"; then
HAVE_GNOME_BLUETOOTH_TRUE=
HAVE_GNOME_BLUETOOTH_FALSE='#'
else
HAVE_GNOME_BLUETOOTH_TRUE='#'
HAVE_GNOME_BLUETOOTH_FALSE=
fi
save_CFLAGS="$CFLAGS"
CFLAGS=$GNOME_BLUETOOTH_CFLAGS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BLUETOOTH_TYPE_SPEAKERS" >&5
printf %s "checking for BLUETOOTH_TYPE_SPEAKERS... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <bluetooth-client.h>
int
main (void)
{
int type = BLUETOOTH_TYPE_SPEAKERS;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
printf "%s\n" "#define HAVE_BLUETOOTH_TYPE_SPEAKERS 1" >>confdefs.h
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CFLAGS="$save_CFLAGS"
 
 
# Check whether --with-compiz-session was given.
......@@ -22849,10 +22769,6 @@ if test -z "${ENABLE_SYSTEMD_SESSION_TRUE}" && test -z "${ENABLE_SYSTEMD_SESSION
as_fn_error $? "conditional \"ENABLE_SYSTEMD_SESSION\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_GNOME_BLUETOOTH_TRUE}" && test -z "${HAVE_GNOME_BLUETOOTH_FALSE}"; then
as_fn_error $? "conditional \"HAVE_GNOME_BLUETOOTH\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${WITH_COMPIZ_SESSION_TRUE}" && test -z "${WITH_COMPIZ_SESSION_FALSE}"; then
as_fn_error $? "conditional \"WITH_COMPIZ_SESSION\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
......@@ -23247,7 +23163,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by gnome-flashback $as_me 3.45.1, which was
This file was extended by gnome-flashback $as_me 3.46.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -23315,7 +23231,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
gnome-flashback config.status 3.45.1
gnome-flashback config.status 3.46.0
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
 
......
......@@ -3,8 +3,8 @@ dnl Define version info
dnl **************************************************************************
m4_define([gf_major_version], [3])
m4_define([gf_minor_version], [45])
m4_define([gf_micro_version], [1])
m4_define([gf_minor_version], [46])
m4_define([gf_micro_version], [0])
m4_define([gf_version], [gf_major_version.gf_minor_version.gf_micro_version])
dnl **************************************************************************
......@@ -90,7 +90,7 @@ dnl **************************************************************************
GDK_PIXBUF_REQUIRED=2.32.2
GTK_REQUIRED=3.22.0
LIBGNOME_DESKTOP_REQUIRED=3.12.0
LIBGNOME_DESKTOP_REQUIRED=43
LIBGNOME_PANEL_REQUIRED=3.35.2
CANBERRA_REQUIRED=0.13
GLIB_REQUIRED=2.67.3
......@@ -291,15 +291,6 @@ PKG_CHECK_EXISTS([pango >= 1.44.0],
AC_DEFINE([HAVE_PANGO144], [1],
[Define if Pango is 1.44.0 or newer]))
dnl **************************************************************************
dnl Check if we have gnome-desktop 43.alpha or newer
dnl **************************************************************************
PKG_CHECK_EXISTS([gnome-desktop-3.0 >= 43.alpha],
AC_DEFINE([HAVE_GNOME_DESKTOP_43_ALPHA], [1],
[Define if gnome-desktop is 43.alpha or newer]))
dnl **************************************************************************
dnl Systemd session
dnl **************************************************************************
......@@ -340,33 +331,7 @@ PKG_CHECK_MODULES([SYSTEM_INDICATORS], [
upower-glib
])
PKG_CHECK_EXISTS([gnome-bluetooth-1.0], [
found_gnome_bluetooth="yes"
PKG_CHECK_MODULES([GNOME_BLUETOOTH], [gnome-bluetooth-1.0])
AC_DEFINE([HAVE_GNOME_BLUETOOTH], [1],
[Define if gnome-desktop is 43.alpha or newer])
], [
found_gnome_bluetooth="no"
])
AM_CONDITIONAL([HAVE_GNOME_BLUETOOTH], [test "x$found_gnome_bluetooth" = "xyes"])
save_CFLAGS="$CFLAGS"
CFLAGS=$GNOME_BLUETOOTH_CFLAGS
AC_MSG_CHECKING([for BLUETOOTH_TYPE_SPEAKERS])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([
#include <bluetooth-client.h>
], [
int type = BLUETOOTH_TYPE_SPEAKERS;
])
], [
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_BLUETOOTH_TYPE_SPEAKERS], [1], [xxx])
], [
AC_MSG_RESULT([no])
])
CFLAGS="$save_CFLAGS"
PKG_CHECK_MODULES([GNOME_BLUETOOTH], [gnome-bluetooth-3.0])
dnl **************************************************************************
dnl Compiz session
......
......@@ -122,49 +122,30 @@ load_icon_in_thread (GTask *task,
return;
}
#ifdef HAVE_GNOME_DESKTOP_43_ALPHA
pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (data->self->factory,
data->uri,
data->content_type,
NULL,
NULL);
#else
pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (data->self->factory,
data->uri,
data->content_type);
#endif
if (pixbuf != NULL)
{
#ifdef HAVE_GNOME_DESKTOP_43_ALPHA
gnome_desktop_thumbnail_factory_save_thumbnail (data->self->factory,
pixbuf,
data->uri,
data->time_modified,
NULL,
NULL);
#else
gnome_desktop_thumbnail_factory_save_thumbnail (data->self->factory,
pixbuf,
data->uri,
data->time_modified);
#endif
g_task_return_pointer (task, pixbuf, g_object_unref);
return;
}
#ifdef HAVE_GNOME_DESKTOP_43_ALPHA
gnome_desktop_thumbnail_factory_create_failed_thumbnail (data->self->factory,
data->uri,
data->time_modified,
NULL,
NULL);
#else
gnome_desktop_thumbnail_factory_create_failed_thumbnail (data->self->factory,
data->uri,
data->time_modified);
#endif
g_task_return_new_error (task,
GF_THUMBNAIL_ERROR,
......
......@@ -10,6 +10,7 @@ eu
fi
fur
he
hr
hu
id
it
......
No preview for this file type