forked from pyrite-dev/milsko
Compare commits
2 commits
fd39a0aa1c
...
6ecc3fc708
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ecc3fc708 | |||
| 87d7157291 |
2 changed files with 21 additions and 18 deletions
|
|
@ -52,13 +52,11 @@ struct _MwLLWaylandTopLevel {
|
|||
|
||||
struct _MwLLWayland {
|
||||
struct _MwLLCommon common;
|
||||
union {
|
||||
struct _MwLLWaylandTopLevel* toplevel;
|
||||
struct wl_subsurface* subsurface;
|
||||
};
|
||||
// data that's only loaded if it's a toplevel
|
||||
struct _MwLLWaylandTopLevel* toplevel;
|
||||
enum {
|
||||
MWLL_WAYLAND_TOPLEVEL = 0,
|
||||
MWLL_WAYLAND_SUBSURFACE = 1,
|
||||
MWLL_WAYLAND_TOPLEVEL = 0,
|
||||
MWLL_WAYLAND_SUBLEVEL = 1,
|
||||
} type;
|
||||
|
||||
struct {
|
||||
|
|
@ -90,8 +88,6 @@ struct _MwLLWayland {
|
|||
MwU32 x, y, ww, wh;
|
||||
MwPoint cur_mouse_pos;
|
||||
|
||||
int last_serial;
|
||||
|
||||
MwLL parent;
|
||||
|
||||
GLuint fbo;
|
||||
|
|
|
|||
|
|
@ -522,7 +522,7 @@ static void setup_toplevel(MwLL r, int x, int y) {
|
|||
// glGenBuffers(1, &vertex_buffer);
|
||||
}
|
||||
|
||||
static void setup_subsurface(MwLL parent, MwLL r, int x, int y) {
|
||||
static void setup_sublevel(MwLL parent, MwLL r, int x, int y) {
|
||||
struct wl_compositor* compositor = parent->wayland.compositor;
|
||||
struct wl_subcompositor* subcompositor = parent->wayland.subcompositor;
|
||||
struct wl_surface* parent_surface = parent->wayland.surface;
|
||||
|
|
@ -533,7 +533,7 @@ static void setup_subsurface(MwLL parent, MwLL r, int x, int y) {
|
|||
topmost_parent = topmost_parent->wayland.parent;
|
||||
}
|
||||
|
||||
r->wayland.type = MWLL_WAYLAND_SUBSURFACE;
|
||||
r->wayland.type = MWLL_WAYLAND_SUBLEVEL;
|
||||
|
||||
r->wayland.display = parent->wayland.display;
|
||||
|
||||
|
|
@ -546,9 +546,9 @@ static void setup_subsurface(MwLL parent, MwLL r, int x, int y) {
|
|||
event_loop(r);
|
||||
wl_region_destroy(region);
|
||||
|
||||
r->wayland.subsurface = wl_subcompositor_get_subsurface(subcompositor, r->wayland.surface, parent_surface);
|
||||
// r->wayland.sublevel = wl_subcompositor_get_sublevel(subcompositor, r->wayland.surface, parent_surface);
|
||||
|
||||
wl_subsurface_set_position(r->wayland.subsurface, x, y);
|
||||
// wl_sublevel_set_position(r->wayland.sublevel, x, y);
|
||||
|
||||
// printf("position %d %d\n", x, y);
|
||||
|
||||
|
|
@ -564,7 +564,7 @@ static void setup_subsurface(MwLL parent, MwLL r, int x, int y) {
|
|||
return;
|
||||
}
|
||||
|
||||
// arrpush(parent->wayland.subsurfaces, r);
|
||||
// arrpush(parent->wayland.sublevels, r);
|
||||
|
||||
r->wayland.configured = MwTRUE;
|
||||
if(!r->wayland.egl_setup) {
|
||||
|
|
@ -605,7 +605,7 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
|
|||
if(parent == NULL) {
|
||||
setup_toplevel(r, x, y);
|
||||
} else {
|
||||
setup_subsurface(parent, r, x, y);
|
||||
setup_sublevel(parent, r, x, y);
|
||||
}
|
||||
|
||||
return r;
|
||||
|
|
@ -628,7 +628,7 @@ static void MwLLSetXYImpl(MwLL handle, int x, int y) {
|
|||
if(handle->wayland.type != MWLL_WAYLAND_TOPLEVEL) {
|
||||
handle->wayland.x = x;
|
||||
handle->wayland.y = y;
|
||||
wl_subsurface_set_position(handle->wayland.subsurface, x, y);
|
||||
// wl_sublevel_set_position(handle->wayland.sublevel, x, y);
|
||||
MwLLForceRender(handle);
|
||||
}
|
||||
}
|
||||
|
|
@ -654,14 +654,14 @@ static void MwLLPolygonImpl(MwLL handle, MwPoint* points, int points_count, MwLL
|
|||
float maxX = 0, maxY = 0;
|
||||
float centerX, centerY;
|
||||
|
||||
glColor3f(color->common.red / 255.0, color->common.green / 255.0, color->common.blue / 255.0);
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
|
||||
for(i = 0; i < points_count; i++) {
|
||||
float x = round(handle->wayland.x) + round(points[i].x);
|
||||
float y = round(handle->wayland.y) + round(points[i].y);
|
||||
|
||||
glColor3f(color->common.red / 255.0, color->common.green / 255.0, color->common.blue / 255.0);
|
||||
|
||||
glVertex2f(x, y);
|
||||
}
|
||||
glEnd();
|
||||
|
|
@ -672,7 +672,15 @@ static void MwLLLineImpl(MwLL handle, MwPoint* points, MwLLColor color) {
|
|||
int i;
|
||||
|
||||
glLineWidth(1);
|
||||
glColor3f(color->common.red / 255.0, color->common.green / 255.0, color->common.blue / 255.0);
|
||||
|
||||
glBegin(GL_LINES);
|
||||
for(i = 0; i < 2; i++) {
|
||||
float x = round(handle->wayland.x) + round(points[i].x);
|
||||
float y = round(handle->wayland.y) + round(points[i].y);
|
||||
|
||||
glVertex2f(x, y);
|
||||
}
|
||||
glEnd();
|
||||
glColor3f(0, 0, 0);
|
||||
}
|
||||
|
|
@ -807,7 +815,6 @@ static void MwLLDrawPixmapImpl(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
|
|||
glTexCoord2f(0.0f, 1);
|
||||
glVertex2f(x, y + rect->height);
|
||||
glEnd();
|
||||
glFinish();
|
||||
}
|
||||
|
||||
static void MwLLSetIconImpl(MwLL handle, MwLLPixmap pixmap) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue