mirror of https://github.com/fltk/fltk
Fixed another flwm crash in Fl_x.cxx (the send_motion pointer must
be ignored if the fl_xmousewin is deleted). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@577 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
72a313292c
commit
c025851f83
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: Fl.cxx,v 1.24.2.5 1999/04/23 06:55:52 bill Exp $"
|
||||
// "$Id: Fl.cxx,v 1.24.2.6 1999/05/06 06:20:46 bill Exp $"
|
||||
//
|
||||
// Main event handling code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -564,8 +564,6 @@ void Fl_Window::hide() {
|
|||
}
|
||||
|
||||
// Make sure no events are sent to this window:
|
||||
if (this == fl_xmousewin) fl_xmousewin = 0;
|
||||
if (this == fl_xfocus) fl_xfocus = 0;
|
||||
fl_throw_focus(this);
|
||||
handle(FL_HIDE);
|
||||
|
||||
|
@ -698,5 +696,5 @@ int fl_old_shortcut(const char* s) {
|
|||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl.cxx,v 1.24.2.5 1999/04/23 06:55:52 bill Exp $".
|
||||
// End of "$Id: Fl.cxx,v 1.24.2.6 1999/05/06 06:20:46 bill Exp $".
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: Fl_Menu_.cxx,v 1.7.2.4 1999/05/06 01:17:49 carl Exp $"
|
||||
// "$Id: Fl_Menu_.cxx,v 1.7.2.5 1999/05/06 06:20:46 bill Exp $"
|
||||
//
|
||||
// Common menu code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -112,7 +112,9 @@ void Fl_Menu_::menu(const Fl_Menu_Item* m) {
|
|||
value_ = menu_ = (Fl_Menu_Item*)m;
|
||||
}
|
||||
|
||||
/* This version is broken
|
||||
#if 1
|
||||
// this version is ok with new Fl_Menu_add code with fl_menu_array_owner:
|
||||
|
||||
void Fl_Menu_::copy(const Fl_Menu_Item* m, void* user_data) {
|
||||
int n = m->size();
|
||||
Fl_Menu_Item* newMenu = new Fl_Menu_Item[n];
|
||||
|
@ -125,9 +127,11 @@ void Fl_Menu_::copy(const Fl_Menu_Item* m, void* user_data) {
|
|||
newMenu++;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// This is Guillaume Nodet's fixed version
|
||||
#else
|
||||
// This is Guillaume Nodet's fixed version for the older Fl_Menu_add
|
||||
// that enlarged the array at powers of 2:
|
||||
|
||||
void Fl_Menu_::copy(const Fl_Menu_Item* m, void* user_data) {
|
||||
int i, s = m->size(), n=s;
|
||||
for (i=0; n; n>>=1, i++);
|
||||
|
@ -143,6 +147,7 @@ void Fl_Menu_::copy(const Fl_Menu_Item* m, void* user_data) {
|
|||
newMenu++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Fl_Menu_::~Fl_Menu_() {
|
||||
clear();
|
||||
|
@ -167,5 +172,5 @@ void Fl_Menu_::clear() {
|
|||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Menu_.cxx,v 1.7.2.4 1999/05/06 01:17:49 carl Exp $".
|
||||
// End of "$Id: Fl_Menu_.cxx,v 1.7.2.5 1999/05/06 06:20:46 bill Exp $".
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: Fl_get_key_win32.cxx,v 1.4 1999/01/07 19:17:32 mike Exp $"
|
||||
// "$Id: Fl_get_key_win32.cxx,v 1.4.2.1 1999/05/06 06:20:47 bill Exp $"
|
||||
//
|
||||
// WIN32 keyboard state routines for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -70,6 +70,7 @@ static const struct {unsigned short vk, fltk;} vktab[] = {
|
|||
{0xc0, '~'},
|
||||
{VK_BACK, FL_BackSpace},
|
||||
{VK_TAB, FL_Tab},
|
||||
{VK_CLEAR, 0xff0b/*XK_Clear*/},
|
||||
{VK_RETURN, FL_Enter},
|
||||
{VK_PAUSE, FL_Pause},
|
||||
{VK_SCROLL, FL_Scroll_Lock},
|
||||
|
@ -131,5 +132,5 @@ int Fl::get_key(int k) {
|
|||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_get_key_win32.cxx,v 1.4 1999/01/07 19:17:32 mike Exp $".
|
||||
// End of "$Id: Fl_get_key_win32.cxx,v 1.4.2.1 1999/05/06 06:20:47 bill Exp $".
|
||||
//
|
||||
|
|
13
src/Fl_x.cxx
13
src/Fl_x.cxx
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// "$Id: Fl_x.cxx,v 1.24.2.5 1999/05/01 15:08:22 mike Exp $"
|
||||
// "$Id: Fl_x.cxx,v 1.24.2.6 1999/05/06 06:20:47 bill Exp $"
|
||||
//
|
||||
// X specific code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
|
@ -156,6 +156,7 @@ int fl_ready() {
|
|||
|
||||
#if CONSOLIDATE_MOTION
|
||||
static Fl_Window* send_motion;
|
||||
extern Fl_Window* fl_xmousewin;
|
||||
#endif
|
||||
static void do_queued_events() {
|
||||
while (XEventsQueued(fl_display,QueuedAfterReading)) {
|
||||
|
@ -164,10 +165,9 @@ static void do_queued_events() {
|
|||
fl_handle(xevent);
|
||||
}
|
||||
#if CONSOLIDATE_MOTION
|
||||
if (send_motion) {
|
||||
Fl_Window* w = send_motion;
|
||||
if (send_motion && send_motion == fl_xmousewin) {
|
||||
send_motion = 0;
|
||||
Fl::handle(FL_MOVE, w);
|
||||
Fl::handle(FL_MOVE, fl_xmousewin);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -420,7 +420,7 @@ int fl_handle(const XEvent& xevent)
|
|||
case MotionNotify:
|
||||
set_event_xy();
|
||||
#if CONSOLIDATE_MOTION
|
||||
send_motion = window;
|
||||
send_motion = fl_xmousewin = window;
|
||||
return 0;
|
||||
#else
|
||||
event = FL_MOVE;
|
||||
|
@ -741,6 +741,7 @@ void Fl_X::sendxjunk() {
|
|||
}
|
||||
|
||||
XSizeHints hints;
|
||||
// memset(&hints, 0, sizeof(hints)); jreiser suggestion to fix purify?
|
||||
hints.min_width = w->minw;
|
||||
hints.min_height = w->minh;
|
||||
hints.max_width = w->maxw;
|
||||
|
@ -865,5 +866,5 @@ void Fl_Window::make_current() {
|
|||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_x.cxx,v 1.24.2.5 1999/05/01 15:08:22 mike Exp $".
|
||||
// End of "$Id: Fl_x.cxx,v 1.24.2.6 1999/05/06 06:20:47 bill Exp $".
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue