set dragging to false when module loads or popups close

ulab-original
jsorg71 17 years ago
parent 3b85502657
commit 76b3e2730e

@ -469,6 +469,7 @@ xrdp_mm_process_login_response(struct xrdp_mm* self, struct stream* s)
{ {
self->wm->login_mode = 10; self->wm->login_mode = 10;
self->wm->pro_layer->app_sck = self->mod->sck; self->wm->pro_layer->app_sck = self->mod->sck;
self->wm->dragging = 0;
} }
} }
} }

@ -664,13 +664,75 @@ xrdp_wm_move_window(struct xrdp_wm* self, struct xrdp_bitmap* wnd,
return 0; return 0;
} }
/*****************************************************************************/
static int APP_CC
xrdp_wm_undraw_dragging_box(struct xrdp_wm* self, int do_begin_end)
{
int boxx;
int boxy;
if (self == 0)
{
return 0;
}
if (self->dragging)
{
if (self->draggingxorstate)
{
if (do_begin_end)
{
xrdp_painter_begin_update(self->painter);
}
boxx = self->draggingx - self->draggingdx;
boxy = self->draggingy - self->draggingdy;
xrdp_wm_xor_pat(self, boxx, boxy, self->draggingcx, self->draggingcy);
self->draggingxorstate = 0;
if (do_begin_end)
{
xrdp_painter_end_update(self->painter);
}
}
}
return 0;
}
/*****************************************************************************/
static int APP_CC
xrdp_wm_draw_dragging_box(struct xrdp_wm* self, int do_begin_end)
{
int boxx;
int boxy;
if (self == 0)
{
return 0;
}
if (self->dragging)
{
if (!self->draggingxorstate)
{
if (do_begin_end)
{
xrdp_painter_begin_update(self->painter);
}
boxx = self->draggingx - self->draggingdx;
boxy = self->draggingy - self->draggingdy;
xrdp_wm_xor_pat(self, boxx, boxy, self->draggingcx, self->draggingcy);
self->draggingxorstate = 1;
if (do_begin_end)
{
xrdp_painter_end_update(self->painter);
}
}
}
return 0;
}
/*****************************************************************************/ /*****************************************************************************/
int APP_CC int APP_CC
xrdp_wm_mouse_move(struct xrdp_wm* self, int x, int y) xrdp_wm_mouse_move(struct xrdp_wm* self, int x, int y)
{ {
struct xrdp_bitmap* b; struct xrdp_bitmap* b;
int boxx;
int boxy;
if (self == 0) if (self == 0)
{ {
@ -697,18 +759,10 @@ xrdp_wm_mouse_move(struct xrdp_wm* self, int x, int y)
if (self->dragging) if (self->dragging)
{ {
xrdp_painter_begin_update(self->painter); xrdp_painter_begin_update(self->painter);
boxx = self->draggingx - self->draggingdx; xrdp_wm_undraw_dragging_box(self, 0);
boxy = self->draggingy - self->draggingdy;
if (self->draggingxorstate)
{
xrdp_wm_xor_pat(self, boxx, boxy, self->draggingcx, self->draggingcy);
}
self->draggingx = x; self->draggingx = x;
self->draggingy = y; self->draggingy = y;
boxx = self->draggingx - self->draggingdx; xrdp_wm_draw_dragging_box(self, 0);
boxy = self->draggingy - self->draggingdy;
xrdp_wm_xor_pat(self, boxx, boxy, self->draggingcx, self->draggingcy);
self->draggingxorstate = 1;
xrdp_painter_end_update(self->painter); xrdp_painter_end_update(self->painter);
return 0; return 0;
} }
@ -1324,17 +1378,20 @@ xrdp_wm_idle(struct xrdp_wm* self)
self->login_mode = 1; /* put the wm in login mode */ self->login_mode = 1; /* put the wm in login mode */
list_clear(self->log); list_clear(self->log);
xrdp_wm_delete_all_childs(self); xrdp_wm_delete_all_childs(self);
self->dragging = 0;
xrdp_wm_init(self); xrdp_wm_init(self);
} }
else if (self->login_mode == 2) else if (self->login_mode == 2)
{ {
self->login_mode = 3; /* put the wm in connected mode */ self->login_mode = 3; /* put the wm in connected mode */
xrdp_wm_delete_all_childs(self); xrdp_wm_delete_all_childs(self);
self->dragging = 0;
xrdp_mm_connect(self->mm); xrdp_mm_connect(self->mm);
} }
else if (self->login_mode == 10) else if (self->login_mode == 10)
{ {
xrdp_wm_delete_all_childs(self); xrdp_wm_delete_all_childs(self);
self->dragging = 0;
self->login_mode = 11; self->login_mode = 11;
} }
return 0; return 0;

Loading…
Cancel
Save