Browse Source

Minor fixes

master
boisso 7 years ago
parent
commit
5035b2d481
  1. 10
      k-meleon/BrowserFrm.cpp
  2. 1
      k-meleon/BrowserGlue.cpp
  3. 8
      k-meleon/BrowserWindow.cpp
  4. 26
      k-meleon/KmImage.cpp
  5. 9
      k-meleon/KmSkin.cpp

10
k-meleon/BrowserFrm.cpp

@ -229,7 +229,7 @@ BOOL CBrowserFrame::PreTranslateMessage(MSG* pMsg)
return 0;
}
else if (MapVirtualKey(pMsg->wParam, 2 /*MAPVK_VK_TO_CHAR*/) != 0) {
if (!(GetKeyState(VK_CONTROL) & 0x8000) && (!GetActiveView()->IsChild(GetFocus()) || GetActiveView()->GetBrowserWrapper()->InputHasFocus()))
if (!(GetKeyState(VK_MENU) & 0x8000) && (!GetActiveView()->IsChild(GetFocus()) || GetActiveView()->GetBrowserWrapper()->InputHasFocus()))
return 0;
}
@ -316,10 +316,10 @@ void CBrowserFrame::OnDestroy()
// that's bad because our menu is shared between all windows
SetMenu(NULL);
if (!IsDialog())
theApp.plugins.SendMessage("*", "* OnClose", "Destroy", (long)m_hWnd);
theApp.toolbars.CloseWindow(this);
if (!IsDialog()) {
theApp.plugins.SendMessage("*", "* OnClose", "Destroy", (long)m_hWnd);
theApp.toolbars.CloseWindow(this);
}
m_wndStatusBar.RemoveIcon(ID_SECURITY_STATE_ICON);
CFrameWnd::OnDestroy();
}

1
k-meleon/BrowserGlue.cpp

@ -606,6 +606,7 @@ bool CBrowserGlue::performXULCommand(LPCWSTR id, LPCTSTR siteUri)
}
else
{
if (!*id) return false;
UINT nid = theApp.commands.GetId(id);
if (nid) {
mpBrowserFrame->SendMessage(WM_COMMAND, (WPARAM)nid, 0L);

8
k-meleon/BrowserWindow.cpp

@ -260,7 +260,7 @@ BOOL CBrowserWrapper::CreateBrowser(CWnd* parent, uint32_t chromeFlags)
*/
// Finally, show the web browser window
mBaseWindow->SetVisibility(PR_TRUE);
mBaseWindow->SetVisibility(true);
return TRUE;
}
@ -1121,9 +1121,11 @@ BOOL CBrowserWrapper::GetSelection(CString& aSelText)
return TRUE;
}
#include "nsRect.h"
void CBrowserWrapper::SetVisible(BOOL aVisible)
{
GetDocShell()->SetIsActive(aVisible);
mWebBrowser->SetIsActive(aVisible);
}
//#include "nsIWidgetListener.h"
@ -1236,7 +1238,7 @@ BOOL CBrowserWrapper::ViewContentContainsFrames()
rv = mWebNav->GetDocument(getter_AddRefs(domDoc));
if(NS_FAILED(rv))
return FALSE;
// QI nsIDOMDocument for nsIDOMHTMLDocument
nsCOMPtr<nsIDOMHTMLDocument> htmlDoc = do_QueryInterface(domDoc);
if (!htmlDoc)

26
k-meleon/KmImage.cpp

@ -23,27 +23,21 @@
#include "imgILoader.h"
#include "imgIContainer.h"
#include "gfxUtils.h"
#include "MozUtils.h"
#include "kmeleon_plugin.h"
bool IsComCtl6() {
static int isv6 = -1;
if (isv6 != -1) return isv6;
HMODULE hComCtlDll = LoadLibrary(_T("comctl32.dll"));
if (!hComCtlDll) return isv6 = 0;
typedef HRESULT (CALLBACK *PFNDLLGETVERSION)(DLLVERSIONINFO*);
PFNDLLGETVERSION pfnDllGetVersion = (PFNDLLGETVERSION)GetProcAddress(hComCtlDll, "DllGetVersion");
if (!pfnDllGetVersion)
isv6 = 0;
else {
DLLVERSIONINFO dvi = {0};
dvi.cbSize = sizeof(dvi);
HRESULT hRes = (*pfnDllGetVersion)(&dvi);
isv6 = SUCCEEDED(hRes) && dvi.dwMajorVersion >= 6;
if (isv6 != -1) return isv6;
DWORD maj,min;
AtlGetCommCtrlVersion(&maj, &min);
isv6 = maj >= 6;
if (!isv6) {
HMODULE hntdll = GetModuleHandle(L"ntdll.dll");
if (hntdll && GetProcAddress(hntdll, "wine_get_version"))
isv6 = true;
}
FreeLibrary(hComCtlDll);
return isv6;
}

9
k-meleon/KmSkin.cpp

@ -338,11 +338,14 @@ bool KmSkin::Init(LPCTSTR skinName)
Value& confCmd = confCmds[j];
if (confCmd.IsArray()) {
for (SizeType k=0;k<confCmd.Size();k++) {
mImages->mCmdList[theApp.commands.GetId(confCmd[k].GetString())] = pos+j;
int id = theApp.commands.GetId(confCmd[k].GetString());
if (id) mImages->mCmdList[id] = pos+j;
}
} else {
if (confCmd.IsString())
mImages->mCmdList[theApp.commands.GetId(confCmd.GetString())] = pos+j;
if (confCmd.IsString()) {
int id = theApp.commands.GetId(confCmd.GetString());
if (id) mImages->mCmdList[id] = pos+j;
}
}
}
}

Loading…
Cancel
Save