The window was removing the app_server connection too early, and thus hang in Quit().

Removed the stopConnection() method.
Cleaned up header a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12959 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-06-05 18:57:55 +00:00
parent 2e1184a6e4
commit e17b33e56b
2 changed files with 275 additions and 346 deletions

View File

@ -1,5 +1,5 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Copyright (c) 2001-2002, OpenBeOS // Copyright (c) 2001-2005, Haiku
// //
// Permission is hereby granted, free of charge, to any person obtaining a // Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"), // copy of this software and associated documentation files (the "Software"),
@ -23,38 +23,20 @@
// Author: Adrian Oanca (adioanca@mymail.ro) // Author: Adrian Oanca (adioanca@mymail.ro)
// Description: BWindow is the base class for all windows (graphic areas // Description: BWindow is the base class for all windows (graphic areas
// displayed on-screen). // displayed on-screen).
//
//
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// NOTE(!!!) All private non virtual functions are to be renamed following
// this scheme: word_another_third <-> wordAnotherThird
// OBOS Team: If you use one of BWindow's private functions, please addapt to this code
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#ifndef _WINDOW_H #ifndef _WINDOW_H
#define _WINDOW_H #define _WINDOW_H
// Standard Includes -----------------------------------------------------------
// System Includes -------------------------------------------------------------
#include <BeBuild.h> #include <BeBuild.h>
#include <InterfaceDefs.h> #include <InterfaceDefs.h>
#include <List.h> #include <List.h>
#include <Looper.h> #include <Looper.h>
#include <Rect.h> #include <Rect.h>
#include <StorageDefs.h> #include <StorageDefs.h>
// Project Includes ------------------------------------------------------------
#include <View.h> #include <View.h>
// Local Includes --------------------------------------------------------------
// Local Defines ---------------------------------------------------------------
class BPortLink; class BPortLink;
// Globals ---------------------------------------------------------------------
// window definitions ---------------------------------------------------------- // window definitions ----------------------------------------------------------
@ -136,360 +118,317 @@ class ViewAttr;
// BWindow class --------------------------------------------------------------- // BWindow class ---------------------------------------------------------------
class BWindow : public BLooper { class BWindow : public BLooper {
public: public:
BWindow(BRect frame, BWindow(BRect frame, const char* title,
const char* title, window_type type, uint32 flags,
window_type type, uint32 workspace = B_CURRENT_WORKSPACE);
uint32 flags, BWindow(BRect frame, const char* title,
uint32 workspace = B_CURRENT_WORKSPACE); window_look look, window_feel feel,
BWindow(BRect frame, uint32 flags,
const char* title, uint32 workspace = B_CURRENT_WORKSPACE);
window_look look, virtual ~BWindow();
window_feel feel,
uint32 flags,
uint32 workspace = B_CURRENT_WORKSPACE);
virtual ~BWindow();
BWindow(BMessage* data); BWindow(BMessage* data);
static BArchivable *Instantiate(BMessage* data); static BArchivable *Instantiate(BMessage* data);
virtual status_t Archive(BMessage* data, bool deep = true) const; virtual status_t Archive(BMessage* data, bool deep = true) const;
virtual void Quit(); virtual void Quit();
void Close(); // Synonym of Quit() void Close() { Quit(); }
void AddChild(BView* child, BView* before = NULL); void AddChild(BView* child, BView* before = NULL);
bool RemoveChild(BView* child); bool RemoveChild(BView* child);
int32 CountChildren() const; int32 CountChildren() const;
BView *ChildAt(int32 index) const; BView *ChildAt(int32 index) const;
virtual void DispatchMessage(BMessage* message, BHandler* handler); virtual void DispatchMessage(BMessage* message, BHandler* handler);
virtual void MessageReceived(BMessage* message); virtual void MessageReceived(BMessage* message);
virtual void FrameMoved(BPoint new_position); virtual void FrameMoved(BPoint new_position);
virtual void WorkspacesChanged(uint32 old_ws, uint32 new_ws); virtual void WorkspacesChanged(uint32 old_ws, uint32 new_ws);
virtual void WorkspaceActivated(int32 ws, bool state); virtual void WorkspaceActivated(int32 ws, bool state);
virtual void FrameResized(float new_width, float new_height); virtual void FrameResized(float new_width, float new_height);
virtual void Minimize(bool minimize); virtual void Minimize(bool minimize);
virtual void Zoom( BPoint rec_position, virtual void Zoom(BPoint origin, float width, float height);
float rec_width, void Zoom();
float rec_height); void SetZoomLimits(float maxWidth, float maxHeight);
void Zoom(); virtual void ScreenChanged(BRect screen_size, color_space depth);
void SetZoomLimits(float maxWidth, float maxHeight); // changed from: SetZoomLimits(float max_h, float max_v); void SetPulseRate(bigtime_t rate);
virtual void ScreenChanged(BRect screen_size, color_space depth); bigtime_t PulseRate() const;
void SetPulseRate(bigtime_t rate); void AddShortcut(uint32 key, uint32 modifiers,
bigtime_t PulseRate() const; BMessage *msg);
void AddShortcut( uint32 key, void AddShortcut(uint32 key, uint32 modifiers,
uint32 modifiers, BMessage *msg, BHandler *target);
BMessage* msg); void RemoveShortcut(uint32 key, uint32 modifiers);
void AddShortcut( uint32 key, void SetDefaultButton(BButton* button);
uint32 modifiers, BButton *DefaultButton() const;
BMessage* msg, virtual void MenusBeginning();
BHandler* target); virtual void MenusEnded();
void RemoveShortcut(uint32 key, uint32 modifiers); bool NeedsUpdate() const;
void SetDefaultButton(BButton* button); void UpdateIfNeeded();
BButton *DefaultButton() const; BView *FindView(const char *viewName) const;
virtual void MenusBeginning(); BView *FindView(BPoint) const;
virtual void MenusEnded(); BView *CurrentFocus() const;
bool NeedsUpdate() const; void Activate(bool = true);
void UpdateIfNeeded(); virtual void WindowActivated(bool state);
BView *FindView(const char* viewName) const; // changed from: FindView( const char* view_name );
BView *FindView(BPoint) const;
BView *CurrentFocus() const;
void Activate(bool = true);
virtual void WindowActivated(bool state);
void ConvertToScreen(BPoint* pt) const;
BPoint ConvertToScreen(BPoint pt) const;
void ConvertFromScreen(BPoint* pt) const;
BPoint ConvertFromScreen(BPoint pt) const;
void ConvertToScreen(BRect* rect) const;
BRect ConvertToScreen(BRect rect) const;
void ConvertFromScreen(BRect* rect) const;
BRect ConvertFromScreen(BRect rect) const;
void MoveBy(float dx, float dy);
void MoveTo(BPoint);
void MoveTo(float x, float y);
void ResizeBy(float dx, float dy);
void ResizeTo(float width, float height);
virtual void Show();
virtual void Hide();
bool IsHidden() const;
bool IsMinimized() const;
void Flush() const; void ConvertToScreen(BPoint* pt) const;
void Sync() const; BPoint ConvertToScreen(BPoint pt) const;
void ConvertFromScreen(BPoint* pt) const;
BPoint ConvertFromScreen(BPoint pt) const;
void ConvertToScreen(BRect* rect) const;
BRect ConvertToScreen(BRect rect) const;
void ConvertFromScreen(BRect* rect) const;
BRect ConvertFromScreen(BRect rect) const;
status_t SendBehind(const BWindow* window); void MoveBy(float dx, float dy);
void MoveTo(BPoint);
void MoveTo(float x, float y);
void ResizeBy(float dx, float dy);
void ResizeTo(float width, float height);
void DisableUpdates(); virtual void Show();
void EnableUpdates(); virtual void Hide();
bool IsHidden() const;
bool IsMinimized() const;
void BeginViewTransaction(); // referred as OpenViewTransaction() in BeBook void Flush() const;
void EndViewTransaction(); // referred as CommitViewTransaction() in BeBook void Sync() const;
BRect Bounds() const; status_t SendBehind(const BWindow* window);
BRect Frame() const;
const char *Title() const;
void SetTitle(const char* title);
bool IsFront() const;
bool IsActive() const;
void SetKeyMenuBar(BMenuBar* bar);
BMenuBar *KeyMenuBar() const;
void SetSizeLimits( float minWidth, // changed from: SetSizeLimits(float min_h, float max_h, float min_v, float max_v);
float maxWidth,
float minHeight,
float maxHeight);
void GetSizeLimits( float *minWidth, // changed from: SetSizeLimits(float* min_h, float* max_h, float* min_v, float* max_v);
float *maxWidth,
float *minHeight,
float *maxHeight);
uint32 Workspaces() const;
void SetWorkspaces(uint32);
BView *LastMouseMovedView() const;
virtual BHandler *ResolveSpecifier(BMessage* msg, void DisableUpdates();
int32 index, void EnableUpdates();
BMessage* specifier,
int32 form,
const char* property);
virtual status_t GetSupportedSuites(BMessage* data);
status_t AddToSubset(BWindow* window); void BeginViewTransaction(); // referred as OpenViewTransaction() in BeBook
status_t RemoveFromSubset(BWindow* window); void EndViewTransaction(); // referred as CommitViewTransaction() in BeBook
virtual status_t Perform(perform_code d, void* arg); BRect Bounds() const;
BRect Frame() const;
const char *Title() const;
void SetTitle(const char* title);
bool IsFront() const;
bool IsActive() const;
void SetKeyMenuBar(BMenuBar* bar);
BMenuBar *KeyMenuBar() const;
void SetSizeLimits(float minWidth, float maxWidth,
float minHeight, float maxHeight);
void GetSizeLimits(float *minWidth, float *maxWidth,
float *minHeight, float *maxHeight);
uint32 Workspaces() const;
void SetWorkspaces(uint32);
BView *LastMouseMovedView() const;
status_t SetType(window_type type); virtual BHandler *ResolveSpecifier(BMessage* msg, int32 index,
window_type Type() const; BMessage* specifier, int32 form, const char* property);
virtual status_t GetSupportedSuites(BMessage* data);
status_t SetLook(window_look look); status_t AddToSubset(BWindow* window);
window_look Look() const; status_t RemoveFromSubset(BWindow* window);
status_t SetFeel(window_feel feel); virtual status_t Perform(perform_code d, void* arg);
window_feel Feel() const;
status_t SetFlags(uint32); status_t SetType(window_type type);
uint32 Flags() const; window_type Type() const;
bool IsModal() const; status_t SetLook(window_look look);
bool IsFloating() const; window_look Look() const;
status_t SetWindowAlignment(window_alignment mode, status_t SetFeel(window_feel feel);
int32 h, window_feel Feel() const;
int32 hOffset = 0,
int32 width = 0,
int32 widthOffset = 0,
int32 v = 0,
int32 vOffset = 0,
int32 height = 0,
int32 heightOffset = 0);
status_t GetWindowAlignment(window_alignment* mode = NULL,
int32* h = NULL,
int32* hOffset = NULL,
int32* width = NULL,
int32* widthOffset = NULL,
int32* v = NULL,
int32* vOffset = NULL,
int32* height = NULL,
int32* heightOffset = NULL) const;
virtual bool QuitRequested(); status_t SetFlags(uint32);
virtual thread_id Run(); uint32 Flags() const;
bool IsModal() const;
bool IsFloating() const;
status_t SetWindowAlignment(window_alignment mode, int32 h,
int32 hOffset = 0, int32 width = 0, int32 widthOffset = 0,
int32 v = 0, int32 vOffset = 0, int32 height = 0,
int32 heightOffset = 0);
status_t GetWindowAlignment(window_alignment* mode = NULL,
int32* h = NULL, int32* hOffset = NULL,
int32* width = NULL, int32* widthOffset = NULL,
int32* v = NULL, int32* vOffset = NULL,
int32* height = NULL, int32* heightOffset = NULL) const;
virtual bool QuitRequested();
virtual thread_id Run();
// Private or reserved --------------------------------------------------------- // Private or reserved ---------------------------------------------------------
private: private:
typedef BLooper inherited;
typedef BLooper inherited; friend class BApplication;
friend class BBitmap;
friend class BScrollBar;
friend class BView;
friend class BMenuItem;
friend class BWindowScreen;
friend class BDirectWindow;
friend class BFilePanel;
friend class BHandler;
friend class _BEventMask;
friend void _set_menu_sem_(BWindow* w, sem_id sem);
friend status_t _safe_get_server_token_(const BLooper* , int32* );
friend class BApplication; virtual void _ReservedWindow1();
friend class BBitmap; virtual void _ReservedWindow2();
friend class BScrollBar; virtual void _ReservedWindow3();
friend class BView; virtual void _ReservedWindow4();
friend class BMenuItem; virtual void _ReservedWindow5();
friend class BWindowScreen; virtual void _ReservedWindow6();
friend class BDirectWindow; virtual void _ReservedWindow7();
friend class BFilePanel; virtual void _ReservedWindow8();
friend class BHandler;
friend class _BEventMask;
friend void _set_menu_sem_(BWindow* w, sem_id sem);
friend status_t _safe_get_server_token_(const BLooper* , int32* );
virtual void _ReservedWindow1(); BWindow();
virtual void _ReservedWindow2(); BWindow(BWindow&);
virtual void _ReservedWindow3(); BWindow &operator=(BWindow&);
virtual void _ReservedWindow4();
virtual void _ReservedWindow5();
virtual void _ReservedWindow6();
virtual void _ReservedWindow7();
virtual void _ReservedWindow8();
BWindow(); BWindow(BRect frame, color_space depth,
BWindow(BWindow&); uint32 bitmapFlags, int32 rowBytes);
BWindow &operator=(BWindow&); void InitData(BRect frame, const char* title,
window_look look, window_feel feel,
uint32 flags, uint32 workspace);
status_t ArchiveChildren(BMessage* data, bool deep) const;
status_t UnarchiveChildren(BMessage* data);
void BitmapClose(); // to be implemented
virtual void task_looper(); // thread function - it's here where app_server messages are received
/* void start_drag( BMessage* msg,
int32 token,
BPoint offset,
BRect track_rect,
BHandler* reply_to);
void start_drag( BMessage* msg,
int32 token,
BPoint offset,
int32 bitmap_token,
drawing_mode dragMode,
BHandler* reply_to);
*/
void prepareView(BView* aView); // changed from view_builder(BView* a_view);
void attachView(BView* aView); // changed from attach_builder(BView* a_view);
void detachView(BView* aView); // changed from detach_builder(BView* a_view);
//int32 get_server_token() const;
BMessage *extract_drop(BMessage* an_event, BHandler* *target);
//void movesize(uint32 opcode, float h, float v);
BWindow(BRect frame, color_space depth, // to be implemented //int32 MessagesWaiting();
uint32 bitmapFlags, int32 rowBytes);
void InitData(BRect frame,
const char* title,
window_look look,
window_feel feel,
uint32 flags,
uint32 workspace);
status_t ArchiveChildren(BMessage* data, bool deep) const; // call made from within Archive
status_t UnarchiveChildren(BMessage* data); // Instantiate(BMessage* data)->BWindow(BMessage)->UnarchiveChildren(BMessage* data)
void BitmapClose(); // to be implemented
virtual void task_looper(); // thread function - it's here where app_server messages are received
/* void start_drag( BMessage* msg,
int32 token,
BPoint offset,
BRect track_rect,
BHandler* reply_to);
void start_drag( BMessage* msg,
int32 token,
BPoint offset,
int32 bitmap_token,
drawing_mode dragMode,
BHandler* reply_to);
*/
void prepareView(BView* aView); // changed from view_builder(BView* a_view);
void attachView(BView* aView); // changed from attach_builder(BView* a_view);
void detachView(BView* aView); // changed from detach_builder(BView* a_view);
//int32 get_server_token() const;
BMessage *extract_drop(BMessage* an_event, BHandler* *target);
//void movesize(uint32 opcode, float h, float v);
//int32 MessagesWaiting(); void handle_activate(BMessage* an_event);
//void do_view_frame(BMessage* an_event);
//void do_value_change(BMessage* an_event, BHandler* handler);
//void do_mouse_down(BMessage* an_event, BView* target);
//void do_mouse_moved(BMessage* an_event, BView* target);
//void do_key_down(BMessage* an_event, BHandler* handler);
//void do_key_up(BMessage* an_event, BHandler* handler);
void do_menu_event(BMessage* an_event);
//void do_draw_views();
virtual BMessage *ConvertToMessage(void* raw, int32 code);
//_cmd_key_ *allocShortcut(uint32 key, uint32 modifiers);
//_cmd_key_ *FindShortcut(uint32 key, uint32 modifiers);
void AddShortcut(uint32 key, // !!! - and menu shortcuts to list when a menu is added
uint32 modifiers,
BMenuItem* item);
//void post_message(BMessage* message);
//void SetLocalTitle(const char* new_title);
//void enable_pulsing(bool enable);
BHandler *determine_target(BMessage* msg, BHandler* target, bool pref);
//void kb_navigate();
//void navigate_to_next(int32 direction, bool group = false);
//void set_focus(BView* focus, bool notify_input_server); // what does notify_input_server mean??? why???
bool InUpdate();
void DequeueAll();
//bool find_token_and_handler(BMessage* msg, int32* token, BHandler* *handler);
window_type composeType(window_look look, // changed from: compose_type(...)
window_feel feel) const;
void decomposeType(window_type type, // changed from: decompose_type(...)
window_look* look,
window_feel* feel) const;
void handle_activate(BMessage* an_event); void SetIsFilePanel(bool yes);
//void do_view_frame(BMessage* an_event); bool IsFilePanel() const;
//void do_value_change(BMessage* an_event, BHandler* handler);
//void do_mouse_down(BMessage* an_event, BView* target);
//void do_mouse_moved(BMessage* an_event, BView* target);
//void do_key_down(BMessage* an_event, BHandler* handler);
//void do_key_up(BMessage* an_event, BHandler* handler);
void do_menu_event(BMessage* an_event);
//void do_draw_views();
virtual BMessage *ConvertToMessage(void* raw, int32 code);
//_cmd_key_ *allocShortcut(uint32 key, uint32 modifiers);
//_cmd_key_ *FindShortcut(uint32 key, uint32 modifiers);
void AddShortcut(uint32 key, // !!! - and menu shortcuts to list when a menu is added
uint32 modifiers,
BMenuItem* item);
//void post_message(BMessage* message);
//void SetLocalTitle(const char* new_title);
//void enable_pulsing(bool enable);
BHandler *determine_target(BMessage* msg, BHandler* target, bool pref);
//void kb_navigate();
//void navigate_to_next(int32 direction, bool group = false);
//void set_focus(BView* focus, bool notify_input_server); // what does notify_input_server mean??? why???
bool InUpdate();
void DequeueAll();
//bool find_token_and_handler(BMessage* msg, int32* token, BHandler* *handler);
window_type composeType(window_look look, // changed from: compose_type(...)
window_feel feel) const;
void decomposeType(window_type type, // changed from: decompose_type(...)
window_look* look,
window_feel* feel) const;
void SetIsFilePanel(bool yes); uint32 WindowLookToInteger(window_look wl);
bool IsFilePanel() const; uint32 WindowFeelToInteger(window_feel wf);
// OBOS BWindow's addon functions void BuildTopView();
uint32 WindowLookToInteger(window_look wl); void setFocus(BView *focusView, bool notifyIputServer = false);
uint32 WindowFeelToInteger(window_feel wf);
void BuildTopView();
void stopConnection();
void setFocus(BView *focusView, bool notifyIputServer=false);
bool handleKeyDown( uint32 key, uint32 modifiers); bool handleKeyDown(uint32 key, uint32 modifiers);
// message: B_MOUSE_UP, B_MOUSE_DOWN, B_MOUSE_MOVED // message: B_MOUSE_UP, B_MOUSE_DOWN, B_MOUSE_MOVED
void sendMessageUsingEventMask( int32 message, BPoint where ); void sendMessageUsingEventMask(int32 message, BPoint where);
BView* sendMessageUsingEventMask2( BView* aView, int32 message, BPoint where ); BView* sendMessageUsingEventMask2(BView* aView, int32 message, BPoint where);
void sendPulse( BView* ); void sendPulse(BView *view);
int32 findShortcut(uint32 key, uint32 modifiers); int32 findShortcut(uint32 key, uint32 modifiers);
bool findHandler( BView* start, BHandler* handler ); bool findHandler(BView* start, BHandler* handler);
BView* findView(BView* aView, const char* viewName) const; BView* findView(BView* aView, const char* viewName) const;
BView* findView(BView* aView, BPoint point) const; BView* findView(BView* aView, BPoint point) const;
BView* findView(BView* aView, int32 token); BView* findView(BView* aView, int32 token);
BView* findNextView( BView *focus, uint32 flags); BView* findNextView(BView *focus, uint32 flags);
BView* findPrevView( BView *focus, uint32 flags); BView* findPrevView(BView *focus, uint32 flags);
BView* findLastChild(BView *parent); BView* findLastChild(BView *parent);
bool handleKeyDown( const char key, uint32 modifiers); bool handleKeyDown(const char key, uint32 modifiers);
void handleActivation( bool active ); void handleActivation( bool active);
void activateView( BView *aView, bool active ); void activateView(BView *aView, bool active);
void drawAllViews(BView* aView); void drawAllViews(BView* aView);
void DoUpdate(BView* aView, BRect& area); void DoUpdate(BView* aView, BRect& area);
// Debug // Debug
void PrintToStream() const; void PrintToStream() const;
// END: OBOS addon functions
// 3 deprecated calls // 3 deprecated calls
//void AddFloater(BWindow* a_floating_window); //void AddFloater(BWindow* a_floating_window);
//void RemoveFloater(BWindow* a_floating_window); //void RemoveFloater(BWindow* a_floating_window);
//window_type WindowType() const; //window_type WindowType() const;
char *fTitle; // used private:
int32 server_token; char *fTitle;
bool fInTransaction; // used // changed from: char fInUpdate; int32 server_token; // not yet used
bool fActive; // used // changed from: char f_active; bool fInTransaction;
short fShowLevel; // used bool fActive;
uint32 fFlags; // used short fShowLevel;
uint32 fFlags;
port_id send_port; // used port_id send_port;
port_id receive_port; // used port_id receive_port;
BView *top_view; // used BView *top_view;
BView *fFocus; // used BView *fFocus;
BView *fLastMouseMovedView; // used BView *fLastMouseMovedView;
void *a_session; // unused //changed from _BSession_ void *a_session; // unusedm was _BSession_
BMenuBar *fKeyMenuBar; // used BMenuBar *fKeyMenuBar;
BButton *fDefaultButton; // used BButton *fDefaultButton;
BList accelList; // used BList accelList;
int32 fTopViewToken; // // changed from: int32 top_view_token; int32 fTopViewToken;
bool fPulseEnabled; // used // changed from: bool pulse_enabled; bool fPulseEnabled;
bool fViewsNeedPulse; bool fViewsNeedPulse; // not yet used
bool fIsFilePanel; // used bool fIsFilePanel;
bool fMaskActivated; bool fMaskActivated;
bigtime_t fPulseRate; // used // changed from: bigtime_t pulse_rate; bigtime_t fPulseRate;
bool fWaitingForMenu; bool fWaitingForMenu;
bool fMinimized; // used // changed from: bool fOffscreen; bool fMinimized;
sem_id fMenuSem; sem_id fMenuSem;
float fMaxZoomHeight; // used // changed from: float fMaxZoomH; float fMaxZoomHeight;
float fMaxZoomWidth; // used // changed from: float fMaxZoomV; float fMaxZoomWidth;
float fMinWindHeight; // used // changed from: float fMinWindH; float fMinWindHeight;
float fMinWindWidth; // used // changed from: float fMinWindV; float fMinWindWidth;
float fMaxWindHeight; // used // changed from: float fMaxWindH; float fMaxWindHeight;
float fMaxWindWidth; // used // changed from: float fMaxWindV; float fMaxWindWidth;
BRect fFrame; // used BRect fFrame;
window_look fLook; // used window_look fLook;
ViewAttr *fCurDrawViewState; ViewAttr *fCurDrawViewState; // not yet used
window_feel fFeel; // used window_feel fFeel;
int32 fLastViewToken; int32 fLastViewToken;
BPortLink *fLink; // used // changed from: _CEventPort_* fEventPort; BPortLink *fLink;
BMessageRunner *fPulseRunner; // used BMessageRunner *fPulseRunner;
BRect fCurrentFrame; BRect fCurrentFrame; // not yet used
uint32 _reserved[2]; // was 8 uint32 _reserved[2]; // was 8
#if !_PR3_COMPATIBLE_ #if !_PR3_COMPATIBLE_
uint32 _more_reserved[4]; uint32 _more_reserved[4];
#endif #endif
}; };
// inline definitions ----------------------------------------------------------
inline void BWindow::Close()
{
Quit();
}
//------------------------------------------------------------------------------
#endif // _WINDOW_H #endif // _WINDOW_H
/*
* $Log $
*
* $Id $
*
*/

View File

@ -242,6 +242,10 @@ BWindow::~BWindow()
// disable pulsing // disable pulsing
SetPulseRate(0); SetPulseRate(0);
// tell app_server about our demise
fLink->StartMessage(AS_DELETE_WINDOW);
fLink->Flush();
delete fLink; delete fLink;
delete_port(receive_port); delete_port(receive_port);
} }
@ -328,10 +332,6 @@ BWindow::Quit()
// ... also its children // ... also its children
//detachTopView(); //detachTopView();
STRACE(("Trying to stop connection...\n"));
// tell app_server, this window will finish execution
stopConnection();
STRACE(("Connection stopped!\n"));
if (fFlags & B_QUIT_ON_WINDOW_CLOSE) if (fFlags & B_QUIT_ON_WINDOW_CLOSE)
be_app->PostMessage(B_QUIT_REQUESTED); be_app->PostMessage(B_QUIT_REQUESTED);
@ -2385,16 +2385,6 @@ BWindow::BuildTopView()
} }
void
BWindow::stopConnection()
{
Lock();
fLink->StartMessage(AS_DELETE_WINDOW);
fLink->Flush();
Unlock();
}
void void
BWindow::prepareView(BView *view) BWindow::prepareView(BView *view)
{ {