---
title: "Telegram Desktop: broadcast groups and keys in C++ | VulCode"
description: "In Telegram Desktop we hid a topics toggle the server rejects in broadcast groups and fixed media viewer keys that were lost without focus, in C++ and Qt."
url: "https://vulcode.com/en/opensource/contributions/telegram-desktop"
lang: "en"
---

[All contributions](https://vulcode.com/en/opensource/contributions)

telegramdesktop/tdesktop

# Telegram Desktop

The official desktop client of the Telegram messenger, written in C++ on the Telegram API and the MTProto protocol.

[See the repository](https://github.com/telegramdesktop/tdesktop) [All contributions](https://vulcode.com/en/opensource/contributions)

- **Language**: C++
- **GitHub stars**: 33,661
- **Merged changes**: 2
- **Project site**: [desktop.telegram.org](https://desktop.telegram.org/)

## What we changed

The owner of a broadcast group (gigagroup) no longer sees a topics toggle that failed with CHAT_GIGAGROUP_UNALLOWED. The media viewer responds to keys even when its main widget has no focus.

### What this work shows

- C++ and Qt user interfaces

- Qt event filters and focus

- Chat types in the Telegram API

What was broken

### The topics toggle failed

Broadcast groups (gigagroups) also carry the megagroup flag, so their owner saw the topics toggle in the group settings. Switching it on failed with the server error CHAT_GIGAGROUP_UNALLOWED.

How we fixed it

### The toggle only in regular supergroups

The canEditForum condition in edit_peer_info_box.cpp now rules out gigagroups explicitly with isGigagroup(). Only the creator of a regular supergroup sees the topics toggle.

[#31450](https://github.com/telegramdesktop/tdesktop/pull/31450)

What was broken

### The media viewer ignored keys

Key presses were only handled in the event filter of the _body widget. When that widget had no focus, for example after the window was restored, the media viewer ignored every key.

How we fixed it

### The window filter handles keys

KeyPress and KeyRelease handling moved to the event filter of the whole window in OverlayWidget, so keys work regardless of which widget has focus.

[#31527](https://github.com/telegramdesktop/tdesktop/pull/31527)

## Merged changes 2

- [#31527 Fixed media viewer keys lost when its body has no focus. Merged 26 October 2026](https://github.com/telegramdesktop/tdesktop/pull/31527)

- [#31450 Hide the topics toggle in broadcast group settings Merged 14 October 2026](https://github.com/telegramdesktop/tdesktop/pull/31450)

## What it taught us

In a large C++ application on Qt we can find the one place that decides how the interface behaves: an option's visibility condition that matches what the server accepts, and an event filter that receives keys regardless of focus.

## Other projects we write code for

- [**Godot Engine** C++ · 120,623 stars An open source, multi-platform 2D and 3D game engine with its own editor, where game developers build scenes and interfaces.](https://vulcode.com/en/opensource/contributions/godot)

- [**Audacity** C++ · 19,148 stars A free, open source audio editor and recorder, used for recording and editing audio on Windows, macOS and Linux.](https://vulcode.com/en/opensource/contributions/audacity)

- [**Blender** C++ The free and open source 3D creation suite: modelling, animation, rendering and editing. The code is developed on projects.blender.org, and GitHub only mirrors it.](https://vulcode.com/en/opensource/contributions/blender)

- [**Node.js** JavaScript · 123,955 stars The JavaScript runtime built on V8 that runs servers, command line tools and front-end build pipelines. It ships a built-in node:sqlite module for working with SQLite databases.](https://vulcode.com/en/opensource/contributions/nodejs)

- [**Material UI** JavaScript · 99,391 stars A React component library that implements Google's Material Design: ready-made text fields, selects, buttons and other interface elements.](https://vulcode.com/en/opensource/contributions/material-ui)

- [**Zed** Rust · 95,562 stars A fast code editor in Rust from the creators of Atom and Tree-sitter, with live multiplayer editing.](https://vulcode.com/en/opensource/contributions/zed)

## Describe your project.

A free quote comes back within an hour during working hours.

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)
