mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
Compare commits
2 commits
1e406dd649
...
df8e3d819c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df8e3d819c | ||
|
|
28cd504067 |
4 changed files with 35 additions and 6 deletions
|
|
@ -1,5 +1,3 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<openbox_menu>
|
||||
<!-- Note: for localization support of menu items "client-menu" has to be removed here -->
|
||||
<menu id="client-menu">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
This is a very simple config file with many options missing. For a complete
|
||||
set of options with comments, see docs/rc.xml.all
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
This file contains all supported config elements & attributes with
|
||||
default values.
|
||||
|
|
|
|||
|
|
@ -242,6 +242,39 @@ desktop_update_top_layer_visibility(struct server *server)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Work around rounding issues in some clients (notably Qt apps) where
|
||||
* cursor coordinates in the rightmost or bottom pixel are incorrectly
|
||||
* rounded up, putting them outside the surface bounds. The effect is
|
||||
* especially noticeable in right/bottom desktop panels, since driving
|
||||
* the cursor to the edge of the screen no longer works.
|
||||
*
|
||||
* Under X11, such rounding issues went unnoticed since cursor positions
|
||||
* were always integers (i.e. whole pixel boundaries) anyway. Until more
|
||||
* clients/toolkits are fractional-pixel clean, limit surface cursor
|
||||
* coordinates to (w - 1, h - 1) as a workaround.
|
||||
*/
|
||||
static void
|
||||
avoid_edge_rounding_issues(struct cursor_context *ctx)
|
||||
{
|
||||
if (!ctx->surface) {
|
||||
return;
|
||||
}
|
||||
|
||||
int w = ctx->surface->current.width;
|
||||
int h = ctx->surface->current.height;
|
||||
/*
|
||||
* The cursor isn't expected to be outside the surface bounds
|
||||
* here, but check (sx < w, sy < h) just in case.
|
||||
*/
|
||||
if (ctx->sx > w - 1 && ctx->sx < w) {
|
||||
ctx->sx = w - 1;
|
||||
}
|
||||
if (ctx->sy > h - 1 && ctx->sy < h) {
|
||||
ctx->sy = h - 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: make this less big and scary */
|
||||
struct cursor_context
|
||||
get_cursor_context(struct server *server)
|
||||
|
|
@ -269,6 +302,8 @@ get_cursor_context(struct server *server)
|
|||
ret.node = node;
|
||||
ret.surface = lab_wlr_surface_from_node(node);
|
||||
|
||||
avoid_edge_rounding_issues(&ret);
|
||||
|
||||
#if HAVE_XWAYLAND
|
||||
/* TODO: attach LAB_NODE_UNMANAGED node-descriptor to unmanaged surfaces */
|
||||
if (node->type == WLR_SCENE_NODE_BUFFER) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue