Glasgow Council has been urged to consider stopping pupils going out of school at lunchtime - to keep them away from junk food.
The "lock-in" would stop children eating fast food for lunch
Unhealthy snacks and drinks could also be banned from packed lunches, as part of a healthy eating drive.
A report for Glasgow City Council said many secondary pupils shunned healthier menus offered in schools.
It recommended allowing pupils just an occasional burger or portion of chips in the school canteen.
The research, for the council and the Glasgow Centre for Population Health (GCPH), involved pupils, parents and school staff.
Pupils and parents felt that, in a family context, they were buying and eating more fruit and vegetables.
They also said they were drinking less sugary and fizzy drinks, and more water, milk and fruit juice.
Many respondents thought that school lunches were of good quality and were appetising.
They considered that initiatives provided within school - including breakfast services, fresh water and free fruit schemes - had been very successful.
The research also found however, that packed lunches, brought in from home and consumed for school lunch, were described by pupils and parents as full of fatty, sugary foods and fizzy drinks.
In general, pupils and parents felt that the council should think very carefully before attempting to influence families more directly in their home as such moves would be met with a mixture of indifference, resentment and resistance.
Council education spokesman Bailie Gordon Matheson said: "Glasgow, in common with the rest of Scotland, has a big challenge ahead in improving young people's nutrition.
"We have already established innovative programmes to help make this happen. However, we know that changing dietary habits is a long-term and complex matter.
"We can only make real progress if we genuinely involve young people and parents, especially in the secondary sector. We also need to robustly monitor our efforts. Therefore, I warmly welcome this report and will study its findings in order to better shape future policies."
Fiona Crawford, public health programme manager at GCPH, which co-ordinated the research, added: "What is very encouraging about these findings is the fact that generally, pupils and parents thought that schools should continue with their healthy eating agenda as it would help encourage better nutrition."
Andy MacGregor, research director at the Scottish Centre for Social Research (SCSR), which carried out the study, added: "This research reveals that both pupils and parents are very aware of the other factors that influence what pupils eat outside school and what families eat at home.
"Pupils and parents should be kept as involved as possible in helping to inform the debate around healthy eating and in developing future plans."