icons icon indicating copy to clipboard operation
icons copied to clipboard

Cursors misaligned

Open markodp opened this issue 6 years ago • 4 comments

A lot of cursors don't have proper offset/hotspot set. It's most noticeable with resize cursors while hovering over window resize area.

some cursor examples with highlighted current mouse position:

vlcsnap-2019-04-28-19h24m43s513

vlcsnap-2019-04-28-19h24m54s779

vlcsnap-2019-04-28-19h24m32s372

vlcsnap-2019-04-28-19h23m57s873


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

markodp avatar Apr 28 '19 18:04 markodp

@markodp since the cursors are shipped with the icons, I've transferred this from the stylesheet to the icons repo.

cassidyjames avatar Apr 29 '19 16:04 cassidyjames

Hello. Can you replace the cursor with another, it is not very good quality. I want to offer you my cursor, the first you can see and comment on here - https://www.deviantart.com/vladsukhetskyi/art/Black-cursor-795861907

ghost avatar May 07 '19 01:05 ghost

@markodp what's the program you're using to test this? I'd like to work on a fix for this

danirabbit avatar Dec 30 '19 22:12 danirabbit

It's just a simple tool i wrote to see if my perceptions about misaligned are true. Just use mouse wheel to scroll between cursors.

// valac --pkg gtk+-3.0  cursor.vala

void main(string[] args) {
	new Cursors().run();
}

class Cursors : Gtk.Application {
	protected override void activate() {
		var w = new Gtk.ApplicationWindow(this);
		w.add(new Area());
		w.show_all();
	}
}

class Area : Gtk.DrawingArea {
	public double mx;
	public double my;
	construct {
		add_events(Gdk.EventMask.POINTER_MOTION_MASK|Gdk.EventMask.SCROLL_MASK);
		set_size_request(100, 100);
	}

	public override bool motion_notify_event(Gdk.EventMotion e) {
		mx = e.x;
		my = e.y;
		queue_draw();
		return false;
	}
	public override bool scroll_event (Gdk.EventScroll e) {
		switch(e.direction) {
		 	case DOWN: choice = (choice + 1) % choices.length; break;
			case UP: choice = (choice + choices.length - 1) % choices.length;  break;
		}
		queue_draw();
		return true;
	}
	public override bool draw(Cairo.Context cr) {
		var c = new Gdk.Cursor.from_name(get_display(), choices[choice]);
		get_parent_window().set_cursor(c);

		int w = get_allocated_width();
		int h = get_allocated_height();

		cr.set_source_rgb(0,0,1);
		cr.move_to(5, 20);
		cr.show_text(choices[choice]);

		cr.set_source_rgb(1,0,0);
		cr.set_line_width(1);
		cr.move_to(mx, 0);
		cr.line_to(mx, h);
		cr.move_to(0, my);
		cr.line_to(w, my);
		cr.stroke();

		return false;
	}
	int choice = 2;
	string[] choices = {
		"none",
		"default",
		"help",
		"pointer",
		"context-menu",
		"progress","wait",
		"cell",
		"crosshair",
		"text","vertical-text",
		"alias",
		"copy",
		"no-drop",
		"move",
		"not-allowed",
		"grab","grabbing",
		"all-scroll",
		"col-resize","row-resize",
		"n-resize","e-resize","s-resize","w-resize",
		"ne-resize","nw-resize","sw-resize","se-resize",
		"ew-resize","ns-resize","nesw-resize","nwse-resize",
		"zoom-in","zoom-out",
	};
}

markodp avatar Dec 31 '19 11:12 markodp