зеркало из https://github.com/mozilla/gecko-dev.git
Changes for qnx(photon) platform only. They should not affect building/runtime other platforms.
Set PHOTON_DND in Makefile.in so that we include the Dnd service in the build. Firefox bookmarks check for the Dnd service, and are affected if it's missing. Focus related changes: when the window loses focus, the window must be deactivated ( cursor should stop blinking ). When the window is given focus again by the window manager, the window must be activated ( the same cursor should start blinking ). GetParent should check for mIsDestroying - this fixes a crash in 1.7 ( no crash before ) with http://java.sun.com/j2se/1.3/docs/api/. Click on java.awt and keep the cursor moving. In nsPhMozRemoteHelper.cpp, create the connector name based on the aProgram. Use mozilla-xremote-client to send commands.
This commit is contained in:
Родитель
56d0d7a153
Коммит
4f032f53f0
|
@ -83,6 +83,8 @@ REQUIRES += xremoteservice
|
|||
CPPSRCS += nsPhMozRemoteHelper.cpp
|
||||
endif
|
||||
|
||||
# always include the PHOTON_DND in the build - the bookmarks in firefox require it
|
||||
PHOTON_DND=1
|
||||
ifdef PHOTON_DND
|
||||
CPPSRCS += nsDragService.cpp
|
||||
endif
|
||||
|
@ -99,3 +101,6 @@ include $(topsrcdir)/config/rules.mk
|
|||
DEFINES += -D_IMPL_NS_WIDGET -I$(srcdir)/../xpwidgets -I$(srcdir)
|
||||
CXXFLAGS += $(TK_CFLAGS)
|
||||
|
||||
ifdef PHOTON_DND
|
||||
CXXFLAGS += -DPHOTON_DND
|
||||
endif
|
||||
|
|
|
@ -52,16 +52,6 @@
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/* the connector name that a client can use to remote control this instance of mozilla */
|
||||
|
||||
#if defined(MOZ_PHOENIX)
|
||||
#define RemoteServerName "FirebirdRemoteServer"
|
||||
#elif defined(MOZ_THUNDERBIRD)
|
||||
#define RemoteServerName "ThunderbirdRemoteServer"
|
||||
#else
|
||||
#define RemoteServerName "MozillaRemoteServer"
|
||||
#endif
|
||||
|
||||
#define MOZ_REMOTE_MSG_TYPE 100
|
||||
|
||||
static void const * RemoteMsgHandler( PtConnectionServer_t *connection, void *user_data,
|
||||
|
@ -112,7 +102,11 @@ nsPhXRemoteWidgetHelper::EnableXRemoteCommands( nsIWidget *aWidget, const char *
|
|||
{
|
||||
static PRBool ConnectorCreated = PR_FALSE;
|
||||
|
||||
/* ATENTIE */ printf( "aProgram=%s aProfile=%s aWidget=%p\n", aProgram?aProgram:"NULL", aProfile?aProfile:"NULL", aWidget );
|
||||
|
||||
if( !ConnectorCreated ) {
|
||||
char RemoteServerName[128];
|
||||
sprintf( RemoteServerName, "%s_RemoteServer", aProgram ? aProgram : "mozilla" );
|
||||
/* create a connector for the xremote control */
|
||||
PtConnectorCreate( RemoteServerName, client_connect, NULL );
|
||||
ConnectorCreated = PR_TRUE;
|
||||
|
|
|
@ -88,8 +88,7 @@ nsIDragService *nsWidget::sDragService = nsnull;
|
|||
#endif
|
||||
PRUint32 nsWidget::sWidgetCount = 0;
|
||||
PRBool nsWidget::sJustGotActivated = PR_FALSE;
|
||||
PRBool nsWidget::sJustGotDeactivated = PR_FALSE;
|
||||
|
||||
nsWidget* nsWidget::sFocusWidget = 0;
|
||||
|
||||
nsWidget::nsWidget()
|
||||
{
|
||||
|
@ -132,6 +131,9 @@ nsWidget::nsWidget()
|
|||
|
||||
|
||||
nsWidget::~nsWidget( ) {
|
||||
|
||||
if( sFocusWidget == this ) sFocusWidget = 0;
|
||||
|
||||
// it's safe to always call Destroy() because it will only allow itself to be called once
|
||||
Destroy();
|
||||
|
||||
|
@ -1145,7 +1147,7 @@ int nsWidget::GotFocusCallback( PtWidget_t *widget, void *data, PtCallbackInfo_t
|
|||
{
|
||||
nsWidget *pWidget = (nsWidget *) data;
|
||||
|
||||
if( widget->class_rec->description && PtWidgetIsClass( widget, PtWindow ) ) {
|
||||
if( PtWidgetIsClass( widget, PtWindow ) ) {
|
||||
if( pWidget->mEventCallback ) {
|
||||
|
||||
/* the WM_ACTIVATE code */
|
||||
|
@ -1173,10 +1175,6 @@ int nsWidget::GotFocusCallback( PtWidget_t *widget, void *data, PtCallbackInfo_t
|
|||
int nsWidget::LostFocusCallback( PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo )
|
||||
{
|
||||
nsWidget *pWidget = (nsWidget *) data;
|
||||
if( sJustGotDeactivated ) {
|
||||
sJustGotDeactivated = PR_FALSE;
|
||||
pWidget->DispatchStandardEvent(NS_DEACTIVATE);
|
||||
}
|
||||
pWidget->DispatchStandardEvent(NS_LOSTFOCUS);
|
||||
return Pt_CONTINUE;
|
||||
}
|
||||
|
|
|
@ -97,6 +97,7 @@ public:
|
|||
NS_IMETHOD Destroy(void);
|
||||
inline nsIWidget* GetParent(void)
|
||||
{
|
||||
if( mIsDestroying ) return nsnull;
|
||||
nsIWidget* result = mParent;
|
||||
if( mParent ) NS_ADDREF( result );
|
||||
return result;
|
||||
|
@ -133,12 +134,6 @@ public:
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
inline NS_IMETHOD SetFocus(PRBool aRaise)
|
||||
{
|
||||
if( mWidget ) PtContainerGiveFocus( mWidget, NULL );
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool OnResize(nsSizeEvent event);
|
||||
virtual PRBool OnResize(nsRect &aRect);
|
||||
virtual PRBool OnMove(PRInt32 aX, PRInt32 aY);
|
||||
|
@ -361,7 +356,6 @@ protected:
|
|||
|
||||
// Focus used global variable
|
||||
static nsWidget* sFocusWidget; //Current Focus Widget
|
||||
static PRBool sJustGotDeactivated;
|
||||
static PRBool sJustGotActivated; //For getting rid of the ASSERT ERROR due to reducing suppressing of focus.
|
||||
|
||||
static nsILookAndFeel *sLookAndFeel;
|
||||
|
|
|
@ -654,6 +654,8 @@ int nsWindow::WindowWMHandler( PtWidget_t *widget, void *data, PtCallbackInfo_t
|
|||
if( we->event_state == Ph_WM_EVSTATE_FOCUSLOST ) {
|
||||
/* rollup the menus */
|
||||
if( gRollupWidget && gRollupListener ) gRollupListener->Rollup();
|
||||
|
||||
if( sFocusWidget ) sFocusWidget->DispatchStandardEvent(NS_DEACTIVATE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -951,3 +953,23 @@ int nsWindow::MenuRegionDestroyed( PtWidget_t *widget, void *data, PtCallbackInf
|
|||
}
|
||||
return Pt_CONTINUE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWindow::SetFocus(PRBool aRaise)
|
||||
{
|
||||
sFocusWidget = this;
|
||||
|
||||
if( PtIsFocused( mWidget ) == 2 ) return NS_OK;
|
||||
|
||||
if( mWidget ) {
|
||||
PtWidget_t *disjoint;
|
||||
disjoint = PtFindDisjoint( mWidget );
|
||||
if( PtWidgetIsClass( disjoint, PtWindow ) ) {
|
||||
if( !( PtWindowGetState( disjoint ) & Ph_WM_STATE_ISFOCUS ) ) {
|
||||
nsWindow *pWin = (nsWindow *) GetInstance( disjoint );
|
||||
pWin->GetAttention( -1 );
|
||||
}
|
||||
}
|
||||
PtContainerGiveFocus( mWidget, NULL );
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -92,11 +92,12 @@ public:
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener,
|
||||
PRBool aDoCapture,
|
||||
PRBool aConsumeRollupEvent);
|
||||
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
|
||||
inline NS_IMETHOD GetAttention(PRInt32 aCycleCount)
|
||||
{
|
||||
if( mWidget ) PtWindowToFront( mWidget );
|
||||
|
|
Загрузка…
Ссылка в новой задаче