void Compositor::sendOutputMode(wl_resource *resource) { const QRect &r = m_outputGeometry; wl_output_send_mode(resource, WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED, r.width(), r.height(), 60); }
static void send_output_events (struct wl_resource *resource, MetaWaylandOutput *wayland_output, MetaMonitorInfo *monitor_info, gboolean need_all_events) { int version = wl_resource_get_version (resource); MetaOutput *output = monitor_info->outputs[0]; guint mode_flags = WL_OUTPUT_MODE_CURRENT; MetaMonitorInfo *old_monitor_info = wayland_output->monitor_info; guint old_mode_flags = wayland_output->mode_flags; gint old_scale = wayland_output->scale; gboolean need_done = FALSE; if (need_all_events || old_monitor_info->rect.x != monitor_info->rect.x || old_monitor_info->rect.y != monitor_info->rect.y) { /* * TODO: When we support wl_surface.set_buffer_transform, pass along * the correct transform here instead of always pretending its 'normal'. * The reason for this is to try stopping clients from setting any buffer * transform other than 'normal'. */ wl_output_send_geometry (resource, (int)monitor_info->rect.x, (int)monitor_info->rect.y, monitor_info->width_mm, monitor_info->height_mm, output->subpixel_order, output->vendor, output->product, WL_OUTPUT_TRANSFORM_NORMAL); need_done = TRUE; } if (output->crtc->current_mode == output->preferred_mode) mode_flags |= WL_OUTPUT_MODE_PREFERRED; if (need_all_events || old_monitor_info->rect.width != monitor_info->rect.width || old_monitor_info->rect.height != monitor_info->rect.height || old_monitor_info->refresh_rate != monitor_info->refresh_rate || old_mode_flags != mode_flags) { wl_output_send_mode (resource, mode_flags, (int)monitor_info->rect.width, (int)monitor_info->rect.height, (int)(monitor_info->refresh_rate * 1000)); need_done = TRUE; } if (version >= WL_OUTPUT_SCALE_SINCE_VERSION) { if (need_all_events || old_scale != output->scale) { wl_output_send_scale (resource, output->scale); need_done = TRUE; } if (need_done) wl_output_send_done (resource); } }