Jump to: navigation, search

Mouse Lock Implementation FAQ

3,899 bytes added, 14:56, 6 December 2011
Blur a window on a mochitest
'''Answer 1''': This error is most likely caused by VC's incremental linking reaching its hard coded limit. To fix the problem, edit your ''''''
and locate the line #2505 find the following section of code, and insert the '''-INCREMENTAL:NO''' options in boldinto LDFLAGS flag.
<pre>if test $_MSC_VER -ge 1400; then
dnl For profile-guided optimization
===How to pull new changes for mouselock===
1. Copy the repo URL in git hub <br />
2. git remote add <repo name> git://<url> <br />
3. git checkout master, pull to master first to avoid conflict <br />
4. git pull <repo name>/master <br />
5. git checkout mouselock, change to mouse lock to merge with our up to date master. <br />
6. git merge master <br />
<br />
To fix a merge conflict <br />
1. git status, to see what files have an issue <br />
2. git add <file>, fix then add those files <br />
3. git commit
===Fixing rename errors in github===
One problem that users can run into when trying to merge large number of files in github is the inability of renaming those files. The merge command on github have a limit to how much files can be renamed (not sure the exact limit, but I believe it is O^n limit). To increase the limit for large merge, users can re-set the upper limit with the help of the following command:
<pre>git config merge.renameLimit 999999</pre>
If you wish to re-set to the default limit afterwards, then do this:
<pre>git config --unset merge.renameLimit</pre>
===How do I get a Document (nsIDocument) from a Window (nsIDOMWindow)?===
Answer: Given aWindow, an nsIDOMWindow*
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(aWindow);
nsCOMPtr<nsIDocument> doc;
if (win) {
doc = do_QueryInterface(win->GetExtantDocument());
// doc is now an nsIDocument
===How do I get from a Window (nsIDOMWindow) to a Widget (nsIWidget, nsBaseWidget, nsWindow, etc)?===
Answer: Given aWindow, see
nsCOMPtr<nsPIDOMWindow> domWindow(do_QueryInterface(aWindow));
if (!domWindow)
return NULL;
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(domWindow->GetDocShell());
if (!baseWindow)
return NULL;
nsCOMPtr<nsIWidget> widget;
// widget is now your widget
===How can I stack trace events in Firefox in Windows using Visual Studio?===
'''Answer 1:''' The answer is going to assume you know the basics of debugging on Visual Studio, like how to start debugging, step into, step out, step over, etc. If you haven't already follow the instructions on this [ site]. You don't have to do the optional part. Make sure you build your debug version of Firefox before this. Once you've completed the tasks, find out where you want to put your break point, (use [ mxr] or [ dxr]), and then hit debug. When you rebuild Firefox, you won't need to do the steps all over again, your solution explorer will automatically update itself.
See also, which is old, but likely still helpful.
===How do I programatically set the mouse cursor position?===
'''Answer:''' See how SynthesizeNativeMouseEvent does it on Windows:
5941 nsresult
5942 nsWindow::SynthesizeNativeMouseEvent(nsIntPoint aPoint,
5943 PRUint32 aNativeMessage,
5944 PRUint32 aModifierFlags)
5945 {
5946 RECT r;
5947 ::GetWindowRect(mWnd, &r);
5948 ::SetCursorPos(r.left + aPoint.x, + aPoint.y);
5950 INPUT input;
5951 memset(&input, 0, sizeof(input));
5953 input.type = INPUT_MOUSE;
5954 input.mi.dwFlags = aNativeMessage;
5955 ::SendInput(1, &input, sizeof(INPUT));
5957 return NS_OK;
5958 }
===How do I work with Preferences in Mozilla?===
'''Answer:''' See
===Blur a window on a mochitest===
Instead of window.blur(), will blur the focused window.

Navigation menu