Tdesktop: Opening *.tdesktop-theme with Telegram.exe messes up URL handler

Created on 12 Jan 2017  Â·  8Comments  Â·  Source: telegramdesktop/tdesktop

I've just updated and came to an issue that is literally driving me crazy now.
It's said you have to open *.tdesktop-theme theme file with Telegram to apply it, but instead it messes up URL handler.
Clicking 'document' icon (after downloading file within Telegram) within telegram on downloaded theme shows apply dialog correctly.
(most of the time clicking it redownloads the file again and again... but that's something that was never fixed I guess?)

Steps to reproduce

  • Open *.tdesktop-theme with Telegram.exe (using existing Telegram shortcut) ("Open with" dialog)
    (this might have to be done 2-3 times)

Expected behaviour

  • Apply theme dialog should open within Telegram?

Actual behaviour

  • Opening *.tdesktop-theme or clicking tg:// links causes new Telegram instance to open up, asking to log in.
  • Handler for tg:// links gets messed up:

In registry key HKEY_CLASSES_ROOT\tg\shell\open\command:
"C:\Users\Jacklul\AppData\Roaming\Telegram Desktop\Telegram.exe" -- "%1"

becomes:

"C:\Users\Jacklul\AppData\Roaming\Telegram Desktop\Telegram.exe" -workdir "C:/Users/Jacklul/Desktop/" -- "%1"

causing Telegram to look for tdata in "C:/Users/Jacklul/Desktop/".

OS: Windows 10 x64
Telegram: obviously v1.0.0

auto closed

Most helpful comment

@ADTC Thanks for your feedback.

  1. You can use the color palette file as a theme of its own. So when you test you simply set up your desired background and apply only the color theme each time — the background is unchanged, the colors are changed each time.

  2. You can use "choose background from file" option in Settings to load a color theme as well (just choose a .tdesktop-theme file there).

All 8 comments

I had this issue too.
I'm on windows 10 on x64 system
thank @ADTC for suggestion, I edited the response

@jacklul and @danielpetrica Please note that "x64" simply means a 64-bit OS. It is not the version of Windows. Your version of Windows would be something like 98, 2000, ME, XP, Vista, 7, 8, 10, etc.

I managed to reproduce the error. This happens because of how Windows is handling the association of files with programs. _(I'm on Windows 10 btw, and it's x86 aka 32-bit)_ Windows 10 has a new and annoying feature* where you double-click an unknown file, it will give you a list of programs you can open this file with. Now, note that Telegram is not listed here, because Telegram never indicated in any way that it can handle these tdesktop-theme files. Hence, you have to browse and find Telegram.exe and tell Windows to open it with this EXE file.

Now Windows tries to guess how exactly the program will be told to open the file. Most of the time this works, especially with programs that are specifically designed to open files. But with Telegram this messes up - because Telegram is not designed to handle the file. Windows tries a different method (start Telegram in the folder that the file is in), and Telegram messes up even more (starts a new instance in the said folder).

* Sidenote: Windows Vista and 7 also have a similar feature, but it's less annoying.

Workaround:

For now, you don't have a choice but to stop trying to open tdesktop-theme files by double-clicking. Currently the only way to apply themes is the long-winded way: Upload the file into any chat (maybe the one you talk to yourself in?). Then download it, then click on it _within_ Telegram. As for double-clicking the file itself, you're better off associating it with a ZIP file manager so that you can extract the contents (or whatever you may desire).

To the developers:

Please consider how much of a PITA it is to create new themes when the only way to test each change is to make the change in a text file (called tdesktop-theme), load it into a ZIP file (also called tdesktop-theme for some unknown reason!), drop the ZIP file in a chat to upload it, then download it, then click on it to apply the theme. I really want either (1) double-click on the theme file (even the uncompressed text file itself) to apply it immediately, or (2) much better, if Telegram Desktop can be put in "developer mode" where the theme is applied as a folder (not a ZIP file) and any edits saved to the theme file are applied immediately and automatically.

@ADTC

Please consider how much of a PITA it is to create new themes when the only way to test each change is to make the change in a text file (called tdesktop-theme), load it into a ZIP file (also called tdesktop-theme for some unknown reason!), drop the ZIP file in a chat to upload it, then download it, then click on it to apply the theme. I really want either (1) double-click on the theme file (even the uncompressed text file itself) to apply it immediately, or (2) much better, if Telegram Desktop can be put in "developer mode" where the theme is applied as a folder (not a ZIP file) and any edits saved to the theme file are applied immediately and automatically.

I created a program which allow you to easily create a telegram theme, it's not completed but soon will be. thememaker.site

P.S. If I'm breacking any spam rule, please tell me and I'll delete this comment have a nice day 😄

@ADTC Thanks for your feedback.

  1. You can use the color palette file as a theme of its own. So when you test you simply set up your desired background and apply only the color theme each time — the background is unchanged, the colors are changed each time.

  2. You can use "choose background from file" option in Settings to load a color theme as well (just choose a .tdesktop-theme file there).

Thanks for that. Although it does make it a tad easier by removing the need to compress the file, it is still difficult because you have to do a lot of clicks, to update the theme while testing. Hope you will make it easier still.

@ADTC If you set a theme from file on your hard drive in Settings it is loaded each time you launch the app, so you can change the file and restart the app.

I will try that, but I hope to avoid having to restart TG with each change (when developing a theme of my own). A simple drag-drop interface can be nice. Like how you show "Drop here to send as file" you could add another box "Drop here to apply theme".

Hey there!

We're automatically closing this issue since there was no activity in this issue since 492 days ago. We therefore assume that the user has lost interest or resolved the problem on their own. Closed issues that remain inactive for a long period may get automatically locked.

Don't worry though; if this is in error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

(Please note that this is an automated comment.)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Liudvikas picture Liudvikas  Â·  3Comments

Mindstormer619 picture Mindstormer619  Â·  3Comments

JhonSane picture JhonSane  Â·  3Comments

matteotumiati picture matteotumiati  Â·  3Comments

luisalvarado picture luisalvarado  Â·  3Comments