Skip to content

Commit

Permalink
Revert cursor display patch
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisduerr committed Aug 1, 2024
1 parent a12d382 commit df0bef0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 30 deletions.
4 changes: 2 additions & 2 deletions src/catacomb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,14 @@ impl Catacomb {
self.idle_notifier_state.set_is_inhibited(inhibited);

// Redraw only when there is damage present.
if true || self.windows.damaged() {
if self.windows.damaged() {
// Apply pending client updates.
if let Some(renderer) = self.backend.renderer() {
self.windows.import_buffers(renderer);
}

// Draw all visible clients.
let rendered = self.backend.render(&mut self.windows, &self.touch_state);
let rendered = self.backend.render(&mut self.windows);

// Update render time prediction.
let frame_interval = self.output().frame_interval();
Expand Down
4 changes: 0 additions & 4 deletions src/drawing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ pub struct Graphics {
pub active_drop_target: RenderTexture,
pub urgency_icon: RenderTexture,
pub drop_target: RenderTexture,
pub touch: RenderTexture,

gesture_handle_default: Option<RenderTexture>,
gesture_handle_blocked: Option<RenderTexture>,
Expand All @@ -338,13 +337,10 @@ impl Graphics {

let urgency_icon = Texture::from_buffer(renderer, 1., &URGENCY_ICON_RGBA, 1, 1, true);

let touch = Texture::from_buffer(renderer, 1., &[150, 150, 150, 255], 1, 1, true);

Self {
active_drop_target: RenderTexture::new(active_drop_target),
urgency_icon: RenderTexture::new(urgency_icon),
drop_target: RenderTexture::new(drop_target),
touch: RenderTexture::new(touch),
gesture_handle_default: None,
gesture_handle_blocked: None,
gesture_handle_locked: None,
Expand Down
2 changes: 1 addition & 1 deletion src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct TouchState {
active_app_id: Option<String>,
velocity: Point<f64, Logical>,
events: Vec<TouchEvent>,
pub slot: Option<TouchSlot>,
slot: Option<TouchSlot>,
start: TouchStart,
last_tap: Instant,
is_drag: bool,
Expand Down
13 changes: 5 additions & 8 deletions src/udev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ use tracing::{debug, error};

use crate::catacomb::Catacomb;
use crate::drawing::{CatacombElement, Graphics};
use crate::input::TouchState;
use crate::output::Output;
use crate::protocols::screencopy::frame::Screencopy;
use crate::trace_error;
Expand Down Expand Up @@ -246,13 +245,13 @@ impl Udev {
/// Render a frame.
///
/// Will return `true` if something was rendered.
pub fn render(&mut self, windows: &mut Windows, touch: &TouchState) -> bool {
pub fn render(&mut self, windows: &mut Windows) -> bool {
let output_device = match &mut self.output_device {
Some(output_device) => output_device,
None => return false,
};

match output_device.render(&self.event_loop, windows, touch) {
match output_device.render(&self.event_loop, windows) {
Ok(rendered) => rendered,
Err(err) => {
error!("{err}");
Expand Down Expand Up @@ -620,14 +619,13 @@ impl OutputDevice {
&mut self,
event_loop: &LoopHandle<'static, Catacomb>,
windows: &mut Windows,
touch: &TouchState,
) -> Result<bool, Box<dyn Error>> {
let scale = windows.output().scale();

// Update output mode since we're using static for transforms.
self.drm_compositor.set_output_mode_source(windows.canvas().into());

let textures = windows.textures(&mut self.gles, &mut self.graphics, touch);
let textures = windows.textures(&mut self.gles, &mut self.graphics);
let mut frame_result =
self.drm_compositor.render_frame(&mut self.gles, textures, CLEAR_COLOR)?;
let rendered = !frame_result.is_empty;
Expand All @@ -652,7 +650,7 @@ impl OutputDevice {
return Err(format!("unsupported buffer format: {buffer_type:?}").into());
}

self.copy_framebuffer_shm(windows, region, buffer, touch)?
self.copy_framebuffer_shm(windows, region, buffer)?
};

// Wait for OpenGL sync to submit screencopy, frame.
Expand Down Expand Up @@ -711,7 +709,6 @@ impl OutputDevice {
windows: &mut Windows,
region: Rectangle<i32, Physical>,
buffer: &WlBuffer,
touch: &TouchState,
) -> Result<SyncPoint, Box<dyn Error>> {
// Create and bind an offscreen render buffer.
let buffer_dimensions = renderer::buffer_dimensions(buffer).unwrap();
Expand All @@ -728,7 +725,7 @@ impl OutputDevice {
let damage = transform.transform_rect_in(region, &output_size);

// Collect textures for rendering.
let textures = windows.textures(&mut self.gles, &mut self.graphics, touch);
let textures = windows.textures(&mut self.gles, &mut self.graphics);

// Initialize the buffer to our clear color.
let mut frame = self.gles.render(output_size, transform)?;
Expand Down
15 changes: 0 additions & 15 deletions src/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,28 +368,13 @@ impl Windows {
&mut self,
renderer: &mut GlesRenderer,
graphics: &mut Graphics,
touch: &TouchState,
) -> &[CatacombElement] {
// Clear global damage.
self.dirty = false;

let scale = self.output.scale();
self.textures.clear();

if touch.slot.is_some() {
let mut touch_location = touch.position.to_physical(scale).to_i32_round();
touch_location.y -= 15;
let touch_bounds = Rectangle::from_loc_and_size(touch_location, (20, 20));
CatacombElement::add_element(
&mut self.textures,
graphics.touch.clone(),
touch_location,
touch_bounds,
10.,
scale,
);
}

// Draw gesture handle when not in fullscreen/lock view.
if !matches!(self.view, View::Fullscreen(_) | View::Lock(_)) {
// Get texture for gesture handle.
Expand Down

0 comments on commit df0bef0

Please sign in to comment.