yousseb / meld

Meld for macOS
https://yousseb.github.io/meld/
GNU General Public License v2.0
2.3k stars 120 forks source link

Always starts minimized #106

Open RoyceTheBiker opened 4 years ago

RoyceTheBiker commented 4 years ago

I am using 3.21.0-r1 on Mac OS 10.15.4. I have been using a Mac for six months. I have a wrapper that runs meld using open like so.

#!/bin/sh
# https://osxdaily.com/2007/02/01/how-to-launch-gui-applications-from-the-terminal/
rm -rf ${HOME}/.local/share/meld
rm -rf ${HOME}/Library/Preferences/org.gnome.meld.plist
rm -rf "${HOME}./Library/Saved Application State/org.gnome.meld.savedState/"
export LC_ALL='en_US'
ORIG_DIR=${PWD}
PATH1=$( ( cd $(dirname "${1}"); pwd -P ) )
PATH2=$( ( cd $(dirname "${2}"); pwd -P ) )
P1F1=$(echo ${PATH1}/$(basename "${1}") )
P2F2=$(echo ${PATH2}/$(basename "${2}") )
open -a Meld --args "${P1F1}" "${P2F2}"

Meld always starts minimized and I am not finding any solutions for running open or meld. The fix for background issue [#66] does not resolve it.

RoyceTheBiker commented 4 years ago

It's not really minimized but not actually in the background. It shows on the taskbar as if it is in the background but if there are no other windows open, meld is just not visible until I click on it on the taskbar.

dsbecker commented 4 years ago

Are you by chance using multiple monitors? Unlike most apps which open their window on whatever screen was active at the time, I find Meld always opens on monitor one. Any chance that’s what’s happening to you?

RoyceTheBiker commented 4 years ago

Interesting idea. I only have one active monitor. My Mac Book Pro is connected to my big 4k curved screen and the Mac lid is closed. Since Mac removed X11 sockets, I may not be able to find the information about what screen Meld is starting upon. Is there a way to find out? Is there a way to force it onto the correct screen?

RoyceTheBiker commented 4 years ago

I was able to get the envron dump using these commands.

brew install gnu-sed
ps eww $(pgrep -f -P $(pgrep -f -P 1 Meld) Meld) | gsed -e 's/ /\n/g'

There is a lot in there but this is very interesting.

DISPLAY=/private/tmp/com.apple.launchd.U6X655D7p0/org.macosforge.xquartz:0
dsbecker commented 4 years ago

That seems likely to be your culprit. Now you just have to figure out where that’s coming from. :)

queston02 commented 4 years ago

I am also facing the same issue and i don't have any monitor other than my MacBook Pro monitor. I also tried the fix mentioned here but that didn't helped. My mac version is 10.15.6 and meld version is 3.21.0.osx2

queston02 commented 4 years ago

Was able to make it work after adding the script as part of difftool command in .gitconfig.

[difftool "meld"]
    trustExitCode = true
    cmd = ${HOME}/_clean-meld-settings.sh && open -W -a Meld --args \"$([[ "$LOCAL" == /* ]] && echo "$LOCAL" || echo "$PWD/$LOCAL")\"  \"$([[ "$REMOTE" == /* ]] && echo "$REMOTE" || echo "$PWD/$REMOTE")\"