Ensure that GUI2 windows trigger the redraw-events when closed
This changes the behaviour of the GUI2 draw-layers to rely on tdistributor instead of thandler. tdistributor is used by every GUI2 window, making it the correct choice for triggering a redraw when it is destroyed.
This commit is contained in:
parent
ea649ec0a2
commit
a275ea9053
3 changed files with 17 additions and 2 deletions
|
@ -22,6 +22,8 @@
|
|||
|
||||
#include "SDL_events.h"
|
||||
|
||||
#include "video.hpp"
|
||||
|
||||
#include "utils/boost_function_guarded.hpp"
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
|
|
|
@ -271,6 +271,19 @@ public:
|
|||
void keyboard_remove_from_chain(twidget* widget);
|
||||
|
||||
private:
|
||||
class layer : public video2::draw_layering
|
||||
{
|
||||
public:
|
||||
virtual void handle_event(const SDL_Event& ) {}
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
virtual void handle_window_event(const SDL_Event& ) {}
|
||||
#endif
|
||||
layer() : video2::draw_layering(false) { }
|
||||
};
|
||||
|
||||
// make sure the appropriate things happens when we close.
|
||||
layer layer_;
|
||||
|
||||
#if 0
|
||||
bool hover_pending_; /**< Is there a hover event pending? */
|
||||
unsigned hover_id_; /**< Id of the pending hover event. */
|
||||
|
|
|
@ -121,7 +121,7 @@ static Uint32 timer_sdl_poll_events(Uint32, void*)
|
|||
*
|
||||
* It's a new experimental class.
|
||||
*/
|
||||
class thandler : public video2::draw_layering
|
||||
class thandler : public events::sdl_handler
|
||||
{
|
||||
friend bool gui2::is_in_dialog();
|
||||
|
||||
|
@ -298,7 +298,7 @@ private:
|
|||
};
|
||||
|
||||
thandler::thandler()
|
||||
: video2::draw_layering(false)
|
||||
: events::sdl_handler(false)
|
||||
, mouse_focus(NULL)
|
||||
, dispatchers_()
|
||||
, keyboard_focus_(NULL)
|
||||
|
|
Loading…
Add table
Reference in a new issue